@team-supercharge/oasg 14.1.0-feature-python-fastapi-6dc5992a.0 → 14.1.0-feature-python-fastapi-e25c0a08.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
@@ -704,6 +704,26 @@ Publishing the PyPI packages is done with Twine. For authentication againts the
704
704
  Building the distribution package requires Flit.
705
705
  Publishing the PyPI packages is done with Twine. For authentication againts the PiPI repository you need to set the `TWINE_USERNAME` and `TWINE_PASSWORD` environment variables.
706
706
 
707
+ #### `python-fastapi-raw-request`
708
+
709
+ ```json
710
+ {
711
+ "id": "server-python",
712
+ "type": "python-fastapi-raw-request",
713
+ "source": "source-merged",
714
+ "packageName": "oasg_example",
715
+ "repositoryUrl": "https://gitlab.supercharge.io/api/v4/projects/1226/packages/pypi"
716
+ }
717
+ ```
718
+
719
+ |Parameter| Description| Required | Default |
720
+ |-|-|-|-|
721
+ | packageName | Package nem for the project (convention: snake_case) | Y | - |
722
+ | repositoryUrl | URL of the PyPI repository | Y | - |
723
+
724
+ Building the distribution package requires Flit.
725
+ Publishing the PyPI packages is done with Twine. For authentication againts the PiPI repository you need to set the `TWINE_USERNAME` and `TWINE_PASSWORD` environment variables.
726
+
707
727
  #### `contract-testing`
708
728
 
709
729
  ```json
package/bin/oasg CHANGED
@@ -34,25 +34,26 @@ const PROXY_PORT = '9999';
34
34
 
35
35
  const DEFAULT_GENERATOR_MAPPING = {
36
36
  // client targets
37
- "android": { version: '7.0.1', generator: 'kotlin' },
38
- "angular": { version: '7.0.1', generator: 'typescript-angular' },
39
- "feign": { version: '7.0.1', generator: 'spring' },
40
- "feign-kotlin": { version: '7.0.1', generator: 'kotlin-spring' },
41
- "flutter": { version: '7.0.1', generator: 'dart-dio' },
42
- "ios": { version: '7.0.1', generator: 'swift5' },
43
- "kmp": { version: '7.8.0', generator: 'kotlin' },
44
- "python": { version: '7.0.1', generator: 'python' },
45
- "react": { version: '7.0.1', generator: 'typescript-fetch' },
37
+ "android": { version: '7.0.1', generator: 'kotlin' },
38
+ "angular": { version: '7.0.1', generator: 'typescript-angular' },
39
+ "feign": { version: '7.0.1', generator: 'spring' },
40
+ "feign-kotlin": { version: '7.0.1', generator: 'kotlin-spring' },
41
+ "flutter": { version: '7.0.1', generator: 'dart-dio' },
42
+ "ios": { version: '7.0.1', generator: 'swift5' },
43
+ "kmp": { version: '7.8.0', generator: 'kotlin' },
44
+ "python": { version: '7.0.1', generator: 'python' },
45
+ "react": { version: '7.0.1', generator: 'typescript-fetch' },
46
46
  // server targets
47
- "nestjs": { version: '7.0.1', generator: 'typescript-angular' },
48
- "spring": { version: '7.0.1', generator: 'spring' },
49
- "spring-kotlin": { version: '7.0.1', generator: 'kotlin-spring' },
50
- "python-fastapi": { version: '7.0.1', generator: 'python-fastapi' },
51
- "dotnet": { version: '7.8.0', generator: 'csharp-functions' },
47
+ "nestjs": { version: '7.0.1', generator: 'typescript-angular' },
48
+ "spring": { version: '7.0.1', generator: 'spring' },
49
+ "spring-kotlin": { version: '7.0.1', generator: 'kotlin-spring' },
50
+ "python-fastapi": { version: '7.8.0', generator: 'python-fastapi' },
51
+ "python-fastapi-raw-request": { version: '7.0.1', generator: 'python-fastapi' },
52
+ "dotnet": { version: '7.8.0', generator: 'csharp-functions' },
52
53
  // misc targets
53
- "contract-testing": { version: '4.3.1', generator: 'typescript-node' },
54
- "openapi": { version: undefined, generator: undefined },
55
- "stubby": { version: '4.3.1', generator: 'stubby' },
54
+ "contract-testing": { version: '4.3.1', generator: 'typescript-node' },
55
+ "openapi": { version: undefined, generator: undefined },
56
+ "stubby": { version: '4.3.1', generator: 'stubby' },
56
57
  };
57
58
  const DEFAULT_KTLINT_VERSION = '1.0.0';
58
59
  const BIN_FOLDER = 'out/.bin';
package/config.schema.yml CHANGED
@@ -21,6 +21,7 @@ properties:
21
21
  - $ref: '#/targets/ios'
22
22
  - $ref: '#/targets/Python'
23
23
  - $ref: '#/targets/PythonFastApi'
24
+ - $ref: '#/targets/PythonFastApiRawRequest'
24
25
  - $ref: '#/targets/ContractTesting'
25
26
  - $ref: '#/targets/NestJS'
26
27
  - $ref: '#/targets/OpenAPI'
@@ -312,6 +313,20 @@ targets:
312
313
  - packageName
313
314
  - repositoryUrl
314
315
 
316
+ PythonFastApiRawRequest:
317
+ allOf:
318
+ - $ref: '#/targets/Base'
319
+ - properties:
320
+ type:
321
+ pattern: "^python-fastapi-raw-request$"
322
+ packageName:
323
+ type: string
324
+ repositoryUrl:
325
+ type: string
326
+ required:
327
+ - packageName
328
+ - repositoryUrl
329
+
315
330
  ContractTesting:
316
331
  allOf:
317
332
  - $ref: '#/targets/Base'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-supercharge/oasg",
3
- "version": "14.1.0-feature-python-fastapi-6dc5992a.0",
3
+ "version": "14.1.0-feature-python-fastapi-e25c0a08.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",
@@ -240,7 +240,7 @@ task sourceJar(type: Jar) {
240
240
  publishing {
241
241
  publications {
242
242
  maven(MavenPublication) {
243
- groupId = '{{packageName}}'
243
+ groupId = '{{groupId}}'
244
244
  artifactId = '{{artifactId}}'
245
245
  version = "{{artifactVersion}}"
246
246
  artifact(dokkaJar)
@@ -0,0 +1,32 @@
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
+
25
+ touch "src/$packageName/__init__.py"
26
+ python3 -m venv venv
27
+ source venv/bin/activate
28
+ pip install --upgrade pip
29
+ pip install flit==3.9.0
30
+ flit build --no-use-vcs
31
+
32
+ cd ../../
@@ -0,0 +1,7 @@
1
+ {
2
+ "inlineSchemaOptions": {
3
+ "ARRAY_ITEM_SUFFIX": "",
4
+ "MAP_ITEM_SUFFIX": "",
5
+ "SKIP_SCHEMA_REUSE": "true"
6
+ }
7
+ }
@@ -0,0 +1,9 @@
1
+ #/bin/bash
2
+
3
+ source $(dirname "$0")/../common.sh
4
+
5
+ cd out/$targetId
6
+ source venv/bin/activate
7
+ pip install importlib_metadata==7.2.1 twine==4.0.2
8
+ python3 -m twine upload --repository-url $repositoryUrl dist/*
9
+ cd ../..