Skip to content

Commit 7a421cc

Browse files
authored
Merge pull request #52 from Kucoin/dev
Release SDK 1.3.0
2 parents ac128f2 + b911853 commit 7a421cc

File tree

429 files changed

+23639
-8608
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

429 files changed

+23639
-8608
lines changed

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
22

33
API documentation [Changelog](https://www.kucoin.com/docs-new/change-log)
44

5-
Current synchronized API documentation version [20250313](https://www.kucoin.com/docs-new/change-log#20250313)
5+
Current synchronized API documentation version [20250529](https://www.kucoin.com/docs-new/change-log#20250529)
6+
7+
## 2025-06-11(1.3.0)
8+
- Update the latest APIs, documentation, etc
9+
- Introduced a new testing framework for all SDKs
10+
- Expanded regression-test coverage for Python components
11+
- Updated Node.js dependencies to address security vulnerabilities
12+
13+
## 2025-06-11(PHP 0.1.2-alpha)
14+
- Update the latest APIs, documentation, etc
615

716
## 2025-05-29(PHP 0.1.1-alpha)
817
- Fix compatibility issues on non-macOS systems by enforcing case-sensitive PSR-4 autoloading.

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ $(SUBDIRS):
9999
.PHONY: generate
100100
generate: setup-logs
101101
$(call generate-postman)
102-
$(call generate-code,golang,/pkg/generate,1.2.1)
102+
$(call generate-code,golang,/pkg/generate)
103103
$(call generate-code,python,/kucoin_universal_sdk/generate)
104104
$(call generate-code,node,/src/generate)
105-
$(call generate-code,php,/src/Generate,0.1.1-alpha)
105+
$(call generate-code,php,/src/Generate,0.1.2-alpha)
106106

107107
.PHONY: gen-postman
108108
gen-postman: preprocessor

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ The **KuCoin Universal SDK** is the official SDK provided by KuCoin, offering a
3232

3333
## 🛠️ Installation
3434

35-
### Latest Version: `1.2.0`(Global API version)
35+
### Latest Version: `1.3.0`(Global API version)
3636

37-
### Python Installation(1.2.1.post1)
37+
### Python Installation
3838

3939
```bash
4040
pip install kucoin-universal-sdk
4141
```
4242

43-
### Golang Installation(1.2.1)
43+
### Golang Installation
4444

4545
```bash
4646
go get github.com/Kucoin/kucoin-universal-sdk/sdk/golang
@@ -52,10 +52,10 @@ go mod tidy
5252
npm install kucoin-universal-sdk
5353
```
5454

55-
### PHP Installation(0.1.1-alpha)
55+
### PHP Installation(0.1.2-alpha)
5656
**Note**: This SDK is currently in the Alpha phase. We are actively iterating and improving its features, stability, and documentation. Feedback and contributions are highly encouraged to help us refine the SDK.
5757
```bash
58-
composer require kucoin/kucoin-universal-sdk=0.1.1-alpha
58+
composer require kucoin/kucoin-universal-sdk=0.1.2-alpha
5959
```
6060

6161
### Postman Installation

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.2.0
1+
v1.3.0

generator/plugin/src/main/resources/php-sdk/model_ws.mustache

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,20 @@ class {{classname}} implements Serializable{
5555
return $serializer->serialize($this, 'json');
5656
}
5757

58+
/**
59+
* @param string $json
60+
* @param Serializer $serializer
61+
* @return self
62+
*/
5863
public static function jsonDeserialize($json , $serializer) {
64+
if ($json === null) {
65+
return new self();
66+
}
5967
{{#vars}}
60-
{{#isPrimitiveType}}
61-
$obj = new self();
62-
$obj->data = $json;
63-
return $obj;
64-
{{/isPrimitiveType}}
65-
{{^isPrimitiveType}}
66-
$item = $serializer->deserialize($json, 'array<{{modelPackage}}\{{complexType}}>', 'json');
67-
$obj = new self();
68-
$obj->data = $item;
69-
return $obj;
70-
{{/isPrimitiveType}}
68+
$data = $serializer->deserialize($json, '{{{vendorExtensions.annotationType}}}', 'json');
69+
$obj = new self();
70+
$obj->data = $data;
71+
return $obj;
7172
{{/vars}}
7273
}
7374

generator/plugin/src/main/resources/python-sdk/model_ws.mustache

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ class {{classname}}(BaseModel):
168168
if obj is None:
169169
return None
170170

171+
{{#vendorExtensions.x-original-response}}
172+
# original response
173+
obj = {'data':obj}
174+
{{/vendorExtensions.x-original-response}}
171175
if not isinstance(obj, dict):
172176
return cls.model_validate(obj)
173177

generator/plugin/src/test/java/com/kucoin/universal/sdk/plugin/SdkGeneratorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class SdkGeneratorTest {
1010
private static final String SDK_NAME = "php-sdk";
1111
private static final String SPEC_NAME = "../../spec/rest/api/openapi-account-subaccount.json";
1212
private static final String SPEC_ENTRY_NAME = "../../spec/rest/entry/openapi-account.json";
13-
private static final String WS_SPEC_NAME = "../../spec/ws/openapi-margin-private.json";
13+
private static final String WS_SPEC_NAME = "../../spec/ws/openapi-futures-private.json";
1414
private static final String OUTPUT_DIR = "./out";
1515
private static final String CSV_PATH = "../../spec";
1616

generator/postman/collection.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,24 @@ def gen_api(self, item):
9898
index = path.index(path_var_name_ext)
9999
path[index] = "{{" + path_var_name + "}}"
100100

101+
102+
103+
101104
# update request
102105
req_body = {}
103106
if 'type' in request and request['type'] == 'application/json':
107+
108+
example_data = None
109+
if 'examples' in request:
110+
examples = request['examples']
111+
if len(examples) > 0:
112+
example = examples[0]
113+
if isinstance(example, dict):
114+
example_data = example['value']
115+
104116
req_body = {
105117
"mode": "raw",
106-
"raw": request['example'],
118+
"raw": example_data,
107119
"options": {
108120
"raw": {
109121
"language": "json"

generator/preprocessor/api_meta.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,18 +293,28 @@ def generate_path_operation(api):
293293

294294
body_data = api_data['requestBody']
295295

296+
example_data = None
297+
if 'examples' in body_data:
298+
examples = body_data['examples']
299+
if len(examples) > 0:
300+
example = examples[0]
301+
if isinstance(example, dict):
302+
example_data = example['value']
303+
304+
305+
296306
ApiMetaUtil.update_schema(body_data['jsonSchema'])
297307
# ApiMetaUtil.update_response_schema_required(body_data)
298308
path_operation['requestBody'] = {
299309
'content': {
300310
'application/json': {
301311
'schema': body_data['jsonSchema'],
302-
'example': body_data['example'],
312+
'example': example_data,
303313
}
304314
}
305315
}
306316
try:
307-
example_raw = body_data['example']
317+
example_raw = example_data
308318
filtered_data = "\n".join(
309319
line for line in example_raw.splitlines() if not line.strip().startswith("//"))
310320

generator/preprocessor/meta_tools.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ def clear_field(obj):
2828
for o in obj:
2929
MetaTools.clear_field(o)
3030

31+
@staticmethod
32+
def clear_developing(obj):
33+
if 'apiCollection' in obj:
34+
api_collection = obj['apiCollection']
35+
if isinstance(api_collection,list) and 'items' in api_collection[0]:
36+
for item in api_collection[0]['items']:
37+
if 'name' in item and item['name'] == 'Developing':
38+
item['items'] = []
39+
3140
@staticmethod
3241
def clear_api_collection(data):
3342
if type(data) is list:
@@ -99,6 +108,7 @@ def __init__(self, file_path:str):
99108

100109
def clean(self):
101110
self.clear_garbage()
111+
MetaTools.clear_developing(self.data)
102112
MetaTools.clear_field(self.data)
103113

104114
def write(self):

0 commit comments

Comments
 (0)