@team-supercharge/oasg 13.1.1 → 13.2.0-feature-python-fastapi-26619e36.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/bin/oasg CHANGED
@@ -45,6 +45,7 @@ const DEFAULT_GENERATOR_MAPPING = {
45
45
  "nestjs": { version: '7.0.1', generator: 'typescript-angular' },
46
46
  "spring": { version: '7.0.1', generator: 'spring' },
47
47
  "spring-kotlin": { version: '7.0.1', generator: 'kotlin-spring' },
48
+ "python-fastapi": { version: '7.0.1', generator: 'python-fastapi' },
48
49
  // misc targets
49
50
  "contract-testing": { version: '4.3.1', generator: 'typescript-node' },
50
51
  "openapi": { version: undefined, generator: undefined },
package/config.schema.yml CHANGED
@@ -20,6 +20,7 @@ properties:
20
20
  - $ref: '#/targets/Android'
21
21
  - $ref: '#/targets/ios'
22
22
  - $ref: '#/targets/Python'
23
+ - $ref: '#/targets/PythonFastApi'
23
24
  - $ref: '#/targets/ContractTesting'
24
25
  - $ref: '#/targets/NestJS'
25
26
  - $ref: '#/targets/OpenAPI'
@@ -295,6 +296,20 @@ targets:
295
296
  - packageName
296
297
  - repositoryUrl
297
298
 
299
+ PythonFastApi:
300
+ allOf:
301
+ - $ref: '#/targets/Base'
302
+ - properties:
303
+ type:
304
+ pattern: "^python-fastapi$"
305
+ packageName:
306
+ type: string
307
+ repositoryUrl:
308
+ type: string
309
+ required:
310
+ - packageName
311
+ - repositoryUrl
312
+
298
313
  ContractTesting:
299
314
  allOf:
300
315
  - $ref: '#/targets/Base'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-supercharge/oasg",
3
- "version": "13.1.1",
3
+ "version": "13.2.0-feature-python-fastapi-26619e36.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",
@@ -12,7 +12,7 @@ function rewritePathParameters(fileName) {
12
12
  const contents = fs.readFileSync(file, 'utf-8');
13
13
 
14
14
  var result = contents.replace(/\${this\.configuration\.encodeParam\({name:\s"/g, ':');
15
- result = result.replace(/".*}\)}/g, '');
15
+ result = result.replace(/".*?}\)}/g, '');
16
16
 
17
17
  var options = { flag : 'w', encoding: 'utf8' };
18
18
  fs.writeFileSync(file, result, options);
@@ -0,0 +1,22 @@
1
+ #/bin/bash
2
+
3
+ source $(dirname "$0")/../common.sh
4
+
5
+ # change npm pre-release syntax (with - after semver) to python local syntax (with + after semver)
6
+ version=$(echo $version | sed 's/-/\+/')
7
+ echo "[NOTE] version updated to: ${version}"
8
+
9
+ rm -rf out/$targetId
10
+ mkdir -p out/$targetId
11
+
12
+ java -jar $binary generate \
13
+ -g $generatorId \
14
+ -i $openApiFile \
15
+ -t $templateDir \
16
+ -o out/$targetId \
17
+ -c $(dirname "$0")/generator-config.json \
18
+ -p "packageVersion=$version,packageName=$packageName" $generatorCustomArgs
19
+
20
+ cd out/$targetId
21
+ python3 setup.py sdist bdist_wheel
22
+ 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,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 ../..