You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Script to add version header to java sdk on generation (#100)
* feat: script to add version header to java dsdk on generation, some test fixes that are already merged in java sdk
* feat: generation now also injects headers for setInterceptor function of ApiClient
* fix: java sdk version name
@@ -11,7 +11,6 @@ The project is wrapped with npm, we strongly advice to install Node LTS to acces
11
11
## Generating Unit Client Libraries
12
12
13
13
Below you can find examples for generating client libraries using [OpenAPI generator](https://openapi-generator.tech/).
14
-
You may also use any other known generator, such as [Swagger Codegen](https://github.com/swagger-api/swagger-codegen#generating-a-client-from-local-files), download the jar from [here](https://mvnrepository.com/artifact/io.swagger.codegen.v3/swagger-codegen-cli)
15
14
16
15
The following examples are with the use of [openapi-generator-cli](https://github.com/OpenAPITools/openapi-generator-cli).
17
16
@@ -20,129 +19,239 @@ The following examples are with the use of [openapi-generator-cli](https://githu
20
19
### bundle
21
20
22
21
```commandline
23
-
Bundles the open api specification into one file inside of dist folder
22
+
Bundles the open api specification into one file inside the dist folder
24
23
```
25
24
26
25
### generate-java
27
26
28
27
```commandline
29
-
Runs the bundle command and generates java sdk inside of dist folder
28
+
Runs the bundle command and generates java sdk inside the dist folder.
30
29
```
31
30
32
-
### lint
33
-
34
-
```commandline
35
-
Runs redocly lint for schemas to detect any potential issues
36
-
```
37
-
38
-
### format
31
+
### generate-node
39
32
40
33
```commandline
41
-
Applies prettier formatting to the schemas
34
+
Runs the bundle command and generates node sdk inside the dist folder.
42
35
```
43
36
44
-
## Legacy
45
-
46
-
All of the info listed below is related to the legacy functionality and will be deprecated or updated soon
47
-
48
-
### unit-java
37
+
### generate-ruby
49
38
50
39
```commandline
51
-
openapi-generator-cli generate -g java -i openapi.json -o unit
40
+
Runs the bundle command and generates ruby sdk inside the dist folder.
52
41
```
53
42
54
-
### unit-python
55
-
56
-
We recommend using our script which can be found in this repository:
43
+
### generate-python
57
44
58
45
```commandline
59
-
python "./generate.py"
46
+
Runs the bundle command and generates python sdk inside the dist folder.
60
47
```
61
48
62
-
Or generate by yourself with swagger-codegen-cli:
63
-
64
-
```
65
-
java -jar swagger-codegen-cli-3.0.47.jar generate -i openapi.json -l python -o unit
66
-
```
67
-
68
-
### unit-typescript-axios
49
+
### lint
69
50
70
51
```commandline
71
-
openapi-generator-cli generate -g typescript-axios -i openapi.json -o unit -p npmName=TypescriptUnitClient
52
+
Runs redocly lint for schemas to detect any potential issues
72
53
```
73
54
74
-
### unit-ruby
55
+
### format
75
56
76
57
```commandline
77
-
openapi-generator-cli generate -g ruby -i openapi.json -o unit
58
+
Applies prettier formatting to the schemas
78
59
```
79
60
80
61
## Generated Clients Usage Examples
81
62
82
-
#### Python
83
-
84
-
```
85
-
from datetime import date, timedelta
86
-
from swagger_client import configuration, api_client, Address, CreateIndividualApplicationAttributes, FullName, Phone,
@@ -164,12 +273,35 @@ When generating a python-sdk, you should change the configurations to:
164
273
"name": "Authorization"
165
274
}
166
275
276
+
### Java responses
277
+
278
+
We are using `Java native` as a library template during generation of the java sdk and there are issues with types in responses containing raw text or binary files.
279
+
In order to fix that we have a custom script in place. If you would generate a library yourself you should call the `fix-java-file-get-requests` script from package.json providing the `--path=./dist/java-sdk/src/main/java/unit/java/sdk/api/UnitApi.java` argument to fix the errors after the generation.
280
+
167
281
### CLI version
168
282
169
283
Use the follow command to check the openapi-generator-cli version:
170
284
171
285
`openapi-generator-cli version`
172
286
173
-
We recommend using v7.0.1, you can change the version with the command:
287
+
We recommend using v7.9.0, you can change the version with the command:
288
+
289
+
`openapi-generator-cli version-manager set 7.9.0`
290
+
291
+
## Legacy
174
292
175
-
`openapi-generator-cli version-manager set 7.0.1`
293
+
All of the info listed below is related to the legacy functionality and will be deprecated or updated soon
294
+
295
+
### unit-python
296
+
297
+
We recommend using our script which can be found in this repository:
298
+
299
+
```commandline
300
+
python "./generate.py"
301
+
```
302
+
303
+
Or generate by yourself with swagger-codegen-cli:
304
+
305
+
```
306
+
java -jar swagger-codegen-cli-3.0.47.jar generate -i openapi.json -l python -o unit
0 commit comments