@team-supercharge/oasg 16.3.1-chore-update-dotnet-target-81ecf803.0 → 16.4.0-feature-aspdotnetcore-generator-f348f200.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
@@ -1006,6 +1006,27 @@ Validations from OpenAPI spec:
1006
1006
  | packageName | Name of the generated package | Y | - |
1007
1007
  | generatorCustomArgs | Custom arguments of the generator (--global-property, --additional-properties) | N | - |
1008
1008
 
1009
+ #### `dotnet-webapi`
1010
+
1011
+ ```json
1012
+ {
1013
+ "id": "dotnet-webapi",
1014
+ "type": "dotnet-webapi",
1015
+ "source": "source-merged",
1016
+ "sourceUrl": "https://api.nuget.org/v3/index.json",
1017
+ "apiKey": "apiKey",
1018
+ "packageName": "packageName",
1019
+ "generatorCustomArgs": "--global-property=supportingFiles,modelDocs --additional-properties=nullableReferenceTypes=false"
1020
+ }
1021
+ ```
1022
+
1023
+ | Parameter | Description | Required | Default |
1024
+ | ------------------- | ------------------------------------------------------------------------------ | -------- | ------- |
1025
+ | sourceUrl | Url to where the package will be published | Y | - |
1026
+ | apiKey | Api key of nuget source | Y | - |
1027
+ | packageName | Name of the generated package | Y | - |
1028
+ | generatorCustomArgs | Custom arguments of the generator (--global-property, --additional-properties) | N | - |
1029
+
1009
1030
  #### `postman`
1010
1031
 
1011
1032
  ```json
package/bin/oasg CHANGED
@@ -53,7 +53,8 @@ const DEFAULT_GENERATOR_MAPPING = {
53
53
  "spring-kotlin": { version: '7.11.0', generator: 'kotlin-spring' },
54
54
  "python-fastapi": { version: '7.8.0', generator: 'python-fastapi' },
55
55
  "python-fastapi-raw-request": { version: '7.0.1', generator: 'python-fastapi' },
56
- "dotnet": { version: '7.11.0', generator: 'csharp-functions' },
56
+ "dotnet": { version: '7.8.0', generator: 'csharp-functions' },
57
+ "dotnet-webapi": { version: '7.11.0', generator: 'aspnetcore' },
57
58
  // misc targets
58
59
  "contract-testing": { version: '4.3.1', generator: 'typescript-node' },
59
60
  "openapi": { version: undefined, generator: undefined },
package/config.schema.yml CHANGED
@@ -29,6 +29,7 @@ properties:
29
29
  - $ref: '#/targets/Flutter'
30
30
  - $ref: '#/targets/Kmp'
31
31
  - $ref: '#/targets/Dotnet'
32
+ - $ref: '#/targets/DotnetWebApi'
32
33
  - $ref: '#/targets/Postman'
33
34
  - $ref: '#/targets/TypeScriptAxios'
34
35
  - $ref: '#/targets/TypeScriptFetch'
@@ -413,6 +414,23 @@ targets:
413
414
  - apiKey
414
415
  - packageName
415
416
 
417
+ DotnetWebApi:
418
+ allOf:
419
+ - $ref: '#/targets/Base'
420
+ - properties:
421
+ type:
422
+ pattern: '^dotnet-webapi$'
423
+ sourceUrl:
424
+ type: string
425
+ apiKey:
426
+ type: string
427
+ packageName:
428
+ type: string
429
+ required:
430
+ - sourceUrl
431
+ - apiKey
432
+ - packageName
433
+
416
434
  Kmp:
417
435
  allOf:
418
436
  - $ref: '#/targets/Base'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-supercharge/oasg",
3
- "version": "16.3.1-chore-update-dotnet-target-81ecf803.0",
3
+ "version": "16.4.0-feature-aspdotnetcore-generator-f348f200.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",
@@ -9,8 +9,15 @@ dotnet restore
9
9
  dotnet build -c Release
10
10
  dotnet pack -c Release -p:Version=$version -p:IsPackable=true
11
11
 
12
+ isWindows=false
13
+ if [[ "$OSTYPE" == "cygwin"* ]] || [[ "$OSTYPE" == "msys"* ]]; then
14
+ isWindows=true
15
+ fi
16
+ storePasswordOption=$([[ $isWindows == true ]] && echo "" || echo "--store-password-in-clear-text")
17
+
12
18
  # publish
13
19
  echo "<?xml version=\"1.0\" encoding=\"utf-8\"?><configuration></configuration>" > nuget.config
14
- nuget push "src/**/bin/Release/*.nupkg" -ConfigFile nuget.config -ApiKey "${apiKey}" -Source ${sourceUrl}
20
+ dotnet nuget add source "${sourceUrl}" -n Feed -u User -p "${apiKey}" --configfile nuget.config $storePasswordOption
21
+ dotnet nuget push "src/**/bin/Release/*.nupkg" -s ${sourceUrl} -k AZ
15
22
 
16
23
  cd ../..
@@ -0,0 +1,15 @@
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 "packageVersion=$version,packageName=$packageName" \
15
+ $generatorCustomArgs
@@ -0,0 +1,18 @@
1
+ {
2
+ "inlineSchemaOptions": {
3
+ "ARRAY_ITEM_SUFFIX": "",
4
+ "MAP_ITEM_SUFFIX": "",
5
+ "SKIP_SCHEMA_REUSE": "true"
6
+ },
7
+ "additionalProperties": {
8
+ "aspnetCoreVersion": "8.0",
9
+ "operationIsAsync": true,
10
+ "buildTarget": "library",
11
+ "generateBody": false,
12
+ "useDateTimeOffset": true,
13
+ "nullableReferenceTypes": true,
14
+ "operationResultTask": true,
15
+ "enumNameSuffix": "",
16
+ "enumValueSuffix": ""
17
+ }
18
+ }
@@ -0,0 +1,15 @@
1
+ #!/bin/bash
2
+
3
+ source $(dirname "$0")/../common.sh
4
+
5
+ cd out/$targetId
6
+
7
+ # pack
8
+ dotnet restore
9
+ dotnet build -c Release
10
+ dotnet pack -c Release -p:Version=$version -p:IsPackable=true
11
+
12
+ # publish
13
+ dotnet nuget push "src/**/bin/Release/*.nupkg" --api-key "${apiKey}" --source ${sourceUrl}
14
+
15
+ cd ../..