@ama-sdk/schematics 10.0.0-prerelease.100 → 10.0.0-prerelease.102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -1
- package/package.json +8 -8
- package/schematics/java/client-core/swagger-codegen-java-client/target/javaClient-swagger-codegen-tests.jar +0 -0
- package/schematics/java/client-core/swagger-codegen-java-client/target/javaClient-swagger-codegen.jar +0 -0
- package/schematics/typescript/core/openapi-codegen-typescript/target/typescriptFetch-openapi-generator-tests.jar +0 -0
- package/schematics/typescript/core/openapi-codegen-typescript/target/typescriptFetch-openapi-generator.jar +0 -0
package/README.md
CHANGED
|
@@ -78,12 +78,45 @@ If you use `Yarn2+`, you can use the following `scripts` in `package.json`:
|
|
|
78
78
|
|
|
79
79
|
Use `generate` to (re)generate your SDK based on the content of `./swagger-spec.yaml` (make sure you have this file at the root of your project) and `upgrade:repository` to regenerate the structure of your project.
|
|
80
80
|
|
|
81
|
+
#### Light SDK
|
|
82
|
+
|
|
83
|
+
It is also possible to generate a "light" SDK. This type of SDK does not need to generate revivers, which results in a simplified version of the code and reduces the size of the bundle.
|
|
84
|
+
|
|
85
|
+
Please note that revivers are generated for SDKs that use:
|
|
86
|
+
* non-stringified dates
|
|
87
|
+
* dictionaries
|
|
88
|
+
* extensible models
|
|
89
|
+
|
|
90
|
+
##### Dates
|
|
91
|
+
If your specification file includes dates, there are multiple options for the generation of your SDK involving the global property option `stringifyDate`:
|
|
92
|
+
* By default, the option `stringifyDate` is false so dates will be generated as either `utils.Date`, `utils.DateTime`, or `Date`.
|
|
93
|
+
For more information related to these types, check out this [documentation](https://github.com/AmadeusITGroup/otter/tree/main/packages/%40ama-sdk/schematics/schematics/typescript/shell/templates/base#manage-dates).
|
|
94
|
+
* To leave the handling of the timezone to the application and generate the dates as `string` types, the option `stringifyDate` can be set to true. <br>
|
|
95
|
+
This can be done by adding `--global-property stringifyDate` to the generator command.
|
|
96
|
+
* If an existing SDK contains stringified dates that need to be reverted to their expected formats, you can regenerate the SDK by removing the `stringifyDate` option from the global properties (since it is false by default).
|
|
97
|
+
|
|
98
|
+
Example to stringify dates:
|
|
99
|
+
```shell
|
|
100
|
+
yarn schematics @ama-sdk/schematics:typescript-core --spec-path ./swagger-spec.yaml --global-property stringifyDate
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
##### Extensible models
|
|
104
|
+
|
|
105
|
+
You may be in a case in which you want to be able to extend your SDK models and therefore ensure that revivers are generated
|
|
106
|
+
(more info on how to extend a model [here](https://github.com/AmadeusITGroup/otter/tree/main/packages/%40ama-sdk/schematics/schematics/typescript/shell/templates/base#how-to-extend-a-model)).
|
|
107
|
+
To do this, you can use the global property option `allowModelExtension` by adding `--global-property allowModelExtension` to the generator command.
|
|
108
|
+
|
|
109
|
+
Example:
|
|
110
|
+
```shell
|
|
111
|
+
yarn schematics @ama-sdk/schematics:typescript-core --spec-path ./swagger-spec.yaml --global-property allowModelExtension
|
|
112
|
+
```
|
|
113
|
+
|
|
81
114
|
### Debug
|
|
82
115
|
The OpenApi generator extracts an enhanced JSON data model from the specification YAML and uses this data model to feed the templates to generate the code.
|
|
83
116
|
If there is an issue with the files generated with the spec provided, the generator provides debugging features that log this data model.
|
|
84
117
|
|
|
85
118
|
You can use global property options to pass one or both of the following options:
|
|
86
|
-
*
|
|
119
|
+
* debugModels - logs the full JSON structure used to generate models
|
|
87
120
|
* debugOperations - logs the full JSON structure used to generate operations
|
|
88
121
|
|
|
89
122
|
Example:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ama-sdk/schematics",
|
|
3
|
-
"version": "10.0.0-prerelease.
|
|
3
|
+
"version": "10.0.0-prerelease.102",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@ama-sdk/core": "^10.0.0-prerelease.
|
|
51
|
+
"@ama-sdk/core": "^10.0.0-prerelease.102",
|
|
52
52
|
"@angular-devkit/core": "~17.2.0",
|
|
53
53
|
"@angular-devkit/schematics": "~17.2.0",
|
|
54
54
|
"@angular-devkit/schematics-cli": "^17.0.1",
|
|
55
55
|
"@angular/cli": "^17.0.1",
|
|
56
|
-
"@o3r/schematics": "^10.0.0-prerelease.
|
|
56
|
+
"@o3r/schematics": "^10.0.0-prerelease.102",
|
|
57
57
|
"@openapitools/openapi-generator-cli": "~2.9.0",
|
|
58
58
|
"@schematics/angular": "~17.2.0"
|
|
59
59
|
},
|
|
@@ -68,16 +68,16 @@
|
|
|
68
68
|
"tslib": "^2.5.3"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@ama-sdk/core": "^10.0.0-prerelease.
|
|
71
|
+
"@ama-sdk/core": "^10.0.0-prerelease.102",
|
|
72
72
|
"@angular-devkit/schematics-cli": "~17.2.0",
|
|
73
73
|
"@angular-eslint/eslint-plugin": "~17.2.0",
|
|
74
74
|
"@angular/cli": "~17.2.0",
|
|
75
75
|
"@nx/eslint-plugin": "~18.0.2",
|
|
76
76
|
"@nx/jest": "~18.0.2",
|
|
77
|
-
"@o3r/build-helpers": "^10.0.0-prerelease.
|
|
78
|
-
"@o3r/eslint-plugin": "^10.0.0-prerelease.
|
|
79
|
-
"@o3r/schematics": "^10.0.0-prerelease.
|
|
80
|
-
"@o3r/test-helpers": "^10.0.0-prerelease.
|
|
77
|
+
"@o3r/build-helpers": "^10.0.0-prerelease.102",
|
|
78
|
+
"@o3r/eslint-plugin": "^10.0.0-prerelease.102",
|
|
79
|
+
"@o3r/schematics": "^10.0.0-prerelease.102",
|
|
80
|
+
"@o3r/test-helpers": "^10.0.0-prerelease.102",
|
|
81
81
|
"@openapitools/openapi-generator-cli": "~2.9.0",
|
|
82
82
|
"@schematics/angular": "~17.2.0",
|
|
83
83
|
"@stylistic/eslint-plugin-ts": "^1.5.4",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|