@team-supercharge/oasg 16.1.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
@@ -121,6 +121,7 @@ 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` |➖ |🐛 |➖ |💥 |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |🆕 |
126
127
  | `typescript-axios` |🆕 |
@@ -724,6 +725,25 @@ TBD
724
725
  | formatterCustomArgs | Custom arguments of the `ktlint` formatter | N | --disabled_rules=no-wildcard-imports,max-line-length,enum-entry-name-case |
725
726
  | repository | URL of the Maven Repository | N | - |
726
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
+
727
747
  #### `python-legacy`
728
748
 
729
749
  ```json
package/bin/oasg CHANGED
@@ -42,6 +42,7 @@ 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' },
47
48
  "typescript-axios": { version: '7.11.0', generator: 'typescript-axios' },
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'
@@ -288,6 +289,20 @@ targets:
288
289
  - repository
289
290
  - interfaceType
290
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
+
291
306
  PythonLegacy:
292
307
  allOf:
293
308
  - $ref: '#/targets/Base'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-supercharge/oasg",
3
- "version": "16.1.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 ../..