@team-supercharge/oasg 16.0.1-master-453dcbac.0 → 16.2.0

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 CHANGED
@@ -111,7 +111,7 @@ The table below gives an overview of the changes (breaking, non-breaking, bug fi
111
111
  |------------------------------|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
112
112
  | **Internal** | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
113
113
  | _Core_ |➖ |🐛 |đŸ’Ĩ |✨ |🐛 |✨ |➖ |✨ |🐛 |🐛 |➖ |đŸ’Ĩ |đŸ’Ĩ |✨ |đŸ’Ĩ |🆕 |
114
- | _Linter_ |➖ |➖ |➖ |➖ |➖ |đŸ’Ĩ |➖ |➖ |➖ |➖ |🐛 |➖ |✨ |đŸ’Ĩ |🆕 |
114
+ | _Linter_ |🐛 |➖ |➖ |➖ |➖ |đŸ’Ĩ |➖ |➖ |➖ |➖ |🐛 |➖ |✨ |đŸ’Ĩ |🆕 |
115
115
  | **Client Targets** | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
116
116
  | `android` |➖ |➖ |🐛 |đŸ’Ĩ |➖ |➖ |đŸ’Ĩ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |🆕 |
117
117
  | `angular` |➖ |➖ |🐛 |đŸ’Ĩ |➖ |➖ |➖ |🐛 |➖ |➖ |➖ |đŸ’Ĩ |➖ |➖ |➖ |🆕 |
@@ -121,8 +121,11 @@ The table below gives an overview of the changes (breaking, non-breaking, bug fi
121
121
  | `flutter` |➖ |➖ |➖ |🆕 |
122
122
  | `ios` |➖ |➖ |➖ |đŸ’Ĩ |🐛 |➖ |➖ |➖ |✨ |➖ |đŸ’Ĩ |➖ |➖ |✨ |🆕 |
123
123
  | `kmp` |➖ |➖ |🆕 |
124
+ | `python` |🆕 |
124
125
  | `python-legacy` |đŸ’Ĩ |➖ |🐛 |đŸ’Ĩ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |🆕 |
125
126
  | `react` |➖ |🐛 |➖ |đŸ’Ĩ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |🆕 |
127
+ | `typescript-axios` |🆕 |
128
+ | `typescript-fetch` |🆕 |
126
129
  | **Server Targets** | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
127
130
  | `nestjs` |đŸ’Ĩ |đŸ’Ĩ |➖ |đŸ’Ĩ |✨ |➖ |➖ |🐛 |➖ |➖ |✨ |🆕 |
128
131
  | `python-fastapi` |➖ |➖ |🆕 |
@@ -527,6 +530,8 @@ We welcome feedback and contributions to help address this issue.
527
530
  | packageName | Name of the generated NPM package | Y | - |
528
531
  | repository | URL of the NPM package registry | Y | - |
529
532
 
533
+ > â„šī¸ This package offers React Hooks for convenience.
534
+
530
535
  #### `stubby`
531
536
 
532
537
  **When using Stubby, you must use the Supercharge's fork of the OpenApi Generator!**
@@ -720,6 +725,25 @@ TBD
720
725
  | formatterCustomArgs | Custom arguments of the `ktlint` formatter | N | --disabled_rules=no-wildcard-imports,max-line-length,enum-entry-name-case |
721
726
  | repository | URL of the Maven Repository | N | - |
722
727
 
728
+ #### `python`
729
+
730
+ ```json
731
+ {
732
+ "id": "client-python",
733
+ "type": "python",
734
+ "source": "source-merged",
735
+ "packageName": "oasg_example",
736
+ "repositoryUrl": "https://gitlab.supercharge.io/api/v4/projects/1226/packages/pypi"
737
+ }
738
+ ```
739
+
740
+ |Parameter| Description| Required | Default |
741
+ |-|-|-|-|
742
+ | packageName | Package nem for the project (convention: snake_case) | Y | - |
743
+ | repositoryUrl | URL of the PyPI repository | Y | - |
744
+
745
+ Publishing the PyPI packages is done with Twine. For authentication against the PiPI repository you need to set the `TWINE_USERNAME` and `TWINE_PASSWORD` environment variables.
746
+
723
747
  #### `python-legacy`
724
748
 
725
749
  ```json
@@ -996,6 +1020,39 @@ Validations from OpenAPI spec:
996
1020
  |-|-|-|-|
997
1021
  | fileName | Name of the generated file | N | `collection.json` |
998
1022
 
1023
+ #### `typescript-axios`
1024
+
1025
+ ```json
1026
+ {
1027
+ "id": "client-typescript-axios",
1028
+ "type": "typescript-axios",
1029
+ "source": "source-merged",
1030
+ "packageName": "@project/oasg-example-typescript-axios",
1031
+ "repository": "https://gitlab.supercharge.io/api/v4/projects/1226/packages/npm/"
1032
+ }
1033
+
1034
+ |Parameter| Description| Required | Default |
1035
+ |-|-|-|-|
1036
+ | packageName | Name of the generated NPM package | Y | - |
1037
+ | repository | URL of the NPM package registry | Y | - |
1038
+
1039
+
1040
+ #### `typescript-fetch`
1041
+
1042
+ ```json
1043
+ {
1044
+ "id": "client-typescript-fetch",
1045
+ "type": "typescript-fetch",
1046
+ "source": "source-merged",
1047
+ "packageName": "@project/oasg-example-typescript-fetch",
1048
+ "repository": "https://gitlab.supercharge.io/api/v4/projects/1226/packages/npm/"
1049
+ }
1050
+
1051
+ |Parameter| Description| Required | Default |
1052
+ |-|-|-|-|
1053
+ | packageName | Name of the generated NPM package | Y | - |
1054
+ | repository | URL of the NPM package registry | Y | - |
1055
+
999
1056
  ---
1000
1057
 
1001
1058
  # Migration Guide
package/bin/oasg CHANGED
@@ -42,8 +42,11 @@ const DEFAULT_GENERATOR_MAPPING = {
42
42
  "flutter": { version: '7.0.1', generator: 'dart-dio' },
43
43
  "ios": { version: '7.0.1', generator: 'swift5' },
44
44
  "kmp": { version: '7.8.0', generator: 'kotlin' },
45
+ "python": { version: '7.11.0', generator: 'python' },
45
46
  "python-legacy": { version: '7.11.0', generator: 'python-pydantic-v1' },
46
47
  "react": { version: '7.0.1', generator: 'typescript-fetch' },
48
+ "typescript-axios": { version: '7.11.0', generator: 'typescript-axios' },
49
+ "typescript-fetch": { version: '7.11.0', generator: 'typescript-fetch' },
47
50
  // server targets
48
51
  "nestjs": { version: '7.0.1', generator: 'typescript-angular' },
49
52
  "spring": { version: '7.0.1', generator: 'spring' },
package/config.schema.yml CHANGED
@@ -19,6 +19,7 @@ properties:
19
19
  - $ref: '#/targets/Stubby'
20
20
  - $ref: '#/targets/Android'
21
21
  - $ref: '#/targets/ios'
22
+ - $ref: '#/targets/Python'
22
23
  - $ref: '#/targets/PythonLegacy'
23
24
  - $ref: '#/targets/PythonFastApi'
24
25
  - $ref: '#/targets/PythonFastApiRawRequest'
@@ -29,6 +30,8 @@ properties:
29
30
  - $ref: '#/targets/Kmp'
30
31
  - $ref: '#/targets/Dotnet'
31
32
  - $ref: '#/targets/Postman'
33
+ - $ref: '#/targets/TypeScriptAxios'
34
+ - $ref: '#/targets/TypeScriptFetch'
32
35
  required:
33
36
  - targets
34
37
  additionalProperties: false
@@ -286,6 +289,20 @@ targets:
286
289
  - repository
287
290
  - interfaceType
288
291
 
292
+ Python:
293
+ allOf:
294
+ - $ref: '#/targets/Base'
295
+ - properties:
296
+ type:
297
+ pattern: "^python$"
298
+ packageName:
299
+ type: string
300
+ repositoryUrl:
301
+ type: string
302
+ required:
303
+ - packageName
304
+ - repositoryUrl
305
+
289
306
  PythonLegacy:
290
307
  allOf:
291
308
  - $ref: '#/targets/Base'
@@ -430,6 +447,34 @@ targets:
430
447
  fileName:
431
448
  type: string
432
449
 
450
+ TypeScriptAxios:
451
+ allOf:
452
+ - $ref: '#/targets/Base'
453
+ - properties:
454
+ type:
455
+ pattern: "^typescript-axios$"
456
+ packageName:
457
+ type: string
458
+ repository:
459
+ type: string
460
+ required:
461
+ - packageName
462
+ - repository
463
+
464
+ TypeScriptFetch:
465
+ allOf:
466
+ - $ref: '#/targets/Base'
467
+ - properties:
468
+ type:
469
+ pattern: "^typescript-fetch$"
470
+ packageName:
471
+ type: string
472
+ repository:
473
+ type: string
474
+ required:
475
+ - packageName
476
+ - repository
477
+
433
478
  definitions:
434
479
  # default
435
480
  SourceOverrides:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-supercharge/oasg",
3
- "version": "16.0.1-master-453dcbac.0",
3
+ "version": "16.2.0",
4
4
  "description": "Node-based tool to lint OpenAPI documents and generate clients, servers and documentation from them",
5
5
  "author": "Supercharge",
6
6
  "license": "MIT",
@@ -0,0 +1,25 @@
1
+ #/bin/bash
2
+
3
+ source $(dirname "$0")/../common.sh
4
+
5
+ # if the version contains a `-` character, then use PEP 440 beta version syntax
6
+ # example: 1.0.0-beta.1 -> 1.0.0b0+beta.1
7
+ if [[ $version == *"-"* ]]; then
8
+ version=$(echo $version | sed 's/-/b0+/')
9
+ echo "[NOTE] version updated to: ${version}"
10
+ fi
11
+
12
+ rm -rf out/$targetId
13
+ mkdir -p out/$targetId
14
+
15
+ java -jar $binary generate \
16
+ -g $generatorId \
17
+ -i $openApiFile \
18
+ -t $templateDir \
19
+ -o out/$targetId \
20
+ -c $(dirname "$0")/generator-config.json \
21
+ -p "packageVersion=$version,packageName=$packageName" $generatorCustomArgs
22
+
23
+ cd out/$targetId
24
+ python3 setup.py sdist bdist_wheel
25
+ cd ../../
@@ -0,0 +1,8 @@
1
+ {
2
+ "library": "urllib3",
3
+ "inlineSchemaOptions": {
4
+ "ARRAY_ITEM_SUFFIX": "",
5
+ "MAP_ITEM_SUFFIX": "",
6
+ "SKIP_SCHEMA_REUSE": "true"
7
+ }
8
+ }
@@ -0,0 +1,7 @@
1
+ #/bin/bash
2
+
3
+ source $(dirname "$0")/../common.sh
4
+
5
+ cd out/$targetId
6
+ python3 -m twine upload --repository-url $repositoryUrl dist/*
7
+ cd ../..
@@ -0,0 +1,20 @@
1
+ #/bin/bash
2
+
3
+ source $(dirname "$0")/../common.sh
4
+
5
+ rm -rf out/$targetId
6
+ mkdir -p out/$targetId
7
+
8
+ java -jar $binary generate \
9
+ -g $generatorId \
10
+ -i $openApiFile \
11
+ -t $templateDir \
12
+ -o out/$targetId \
13
+ -c $(dirname "$0")/generator-config.json \
14
+ -p "npmVersion=$version,npmName=$packageName,npmRepository=$repository" $generatorCustomArgs
15
+
16
+ cd out/$targetId
17
+
18
+ npm install
19
+ npm run build
20
+ cd ../..
@@ -0,0 +1,20 @@
1
+ {
2
+ "modelPropertyNaming": "original",
3
+ "supportsES6": "true",
4
+ "providedInRoot": "true",
5
+ "ngVersion": "10.0.2",
6
+ "serviceSuffix": "Api",
7
+ "serviceFileSuffix": ".api",
8
+ "stringEnums": "true",
9
+ "enumPropertyNaming": "UPPERCASE",
10
+ "fileNaming": "kebab-case",
11
+ "useSingleRequestParameter": "false",
12
+ "sortModelPropertiesByRequiredFlag": "false",
13
+ "sortParamsByRequiredFlag": "true",
14
+ "inlineSchemaOptions": {
15
+ "ARRAY_ITEM_SUFFIX": "",
16
+ "MAP_ITEM_SUFFIX": "",
17
+ "SKIP_SCHEMA_REUSE": "true",
18
+ "RESOLVE_INLINE_ENUMS": "true"
19
+ }
20
+ }
@@ -0,0 +1,8 @@
1
+ #/bin/bash
2
+
3
+ source $(dirname "$0")/../common.sh
4
+
5
+ cd out/$targetId
6
+ npm publish \
7
+ $(if [[ "$preRelease" == "true" ]]; then echo "--tag next"; fi)
8
+ cd ../..
@@ -0,0 +1,19 @@
1
+ #/bin/bash
2
+
3
+ source $(dirname "$0")/../common.sh
4
+
5
+ rm -rf out/$targetId
6
+ mkdir -p out/$targetId
7
+
8
+ java -jar $binary generate \
9
+ -g $generatorId \
10
+ -i $openApiFile \
11
+ -t $templateDir \
12
+ -o out/$targetId \
13
+ -c $(dirname "$0")/generator-config.json \
14
+ -p "npmVersion=$version,npmName=$packageName,npmRepository=$repository" $generatorCustomArgs
15
+
16
+ cd out/$targetId
17
+ npm install
18
+ npm run build
19
+ cd ../..
@@ -0,0 +1,14 @@
1
+ {
2
+ "typescriptThreePlus": "true",
3
+ "supportsES6": "true",
4
+ "modelPropertyNaming": "original",
5
+ "withInterfaces": "true",
6
+ "fileNaming": "PascalCase",
7
+ "stringEnums": "true",
8
+ "enumPropertyNaming": "UPPERCASE",
9
+ "inlineSchemaOptions": {
10
+ "ARRAY_ITEM_SUFFIX": "",
11
+ "MAP_ITEM_SUFFIX": "",
12
+ "SKIP_SCHEMA_REUSE": "true"
13
+ }
14
+ }
@@ -0,0 +1,8 @@
1
+ #/bin/bash
2
+
3
+ source $(dirname "$0")/../common.sh
4
+
5
+ cd out/$targetId
6
+ npm publish \
7
+ $(if [[ "$preRelease" == "true" ]]; then echo "--tag next"; fi)
8
+ cd ../..