@team-supercharge/oasg 16.7.1-temp-feat-swift-openapi-generator-4739d9f5 → 16.7.1-temp-feat-swift-openapi-generator-f4a258e6

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/config.schema.yml CHANGED
@@ -20,6 +20,7 @@ properties:
20
20
  - $ref: '#/targets/Stubby'
21
21
  - $ref: '#/targets/Android'
22
22
  - $ref: '#/targets/ios'
23
+ - $ref: '#/targets/SwiftOpenAPIGenerator'
23
24
  - $ref: '#/targets/Python'
24
25
  - $ref: '#/targets/PythonLegacy'
25
26
  - $ref: '#/targets/PythonFastApi'
@@ -318,13 +319,13 @@ targets:
318
319
  - properties:
319
320
  type:
320
321
  pattern: "^swift-openapi-generator$"
321
- packageName:
322
+ projectName:
322
323
  type: string
323
- repositoryUrl:
324
+ repository:
324
325
  type: string
325
326
  required:
326
- - packageName
327
- - repositoryUrl
327
+ - projectName
328
+ - repository
328
329
 
329
330
  Python:
330
331
  allOf:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-supercharge/oasg",
3
- "version": "16.7.1-temp-feat-swift-openapi-generator-4739d9f5",
3
+ "version": "16.7.1-temp-feat-swift-openapi-generator-f4a258e6",
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",
@@ -8,6 +8,10 @@ let package = Package(
8
8
  .library(
9
9
  name: "__PROJECT_NAME__",
10
10
  targets: ["__PROJECT_NAME__"]
11
+ ),
12
+ .library(
13
+ name: "__PROJECT_NAME__Server",
14
+ targets: ["__PROJECT_NAME__Server"]
11
15
  )
12
16
  ],
13
17
  dependencies: [
@@ -21,6 +25,12 @@ let package = Package(
21
25
  .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"),
22
26
  .product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"),
23
27
  ]
24
- )
28
+ ),
29
+ .target(
30
+ name: "__PROJECT_NAME__Server",
31
+ dependencies: [
32
+ .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"),
33
+ ]
34
+ ),
25
35
  ]
26
36
  )
@@ -6,16 +6,19 @@ source $(dirname "$0")/../common.sh
6
6
  rm -rf out/$targetId
7
7
  mkdir -p out/$targetId
8
8
 
9
- # Variables
10
- OPENAPI_GENERATOR_CONFIG_PATH=openapi-generator-config.yaml
11
-
12
- # Generate the swift client
9
+ # Generate swift code from OpenAPI spec
13
10
  swift-openapi-generator \
14
11
  generate \
15
- --config "$OPENAPI_GENERATOR_CONFIG_PATH" \
12
+ --config "openapi-generator-config-client.yaml" \
16
13
  --output-directory "out/$targetId/Sources/$projectName" \
17
14
  "$openApiFile"
18
15
 
16
+ swift-openapi-generator \
17
+ generate \
18
+ --config "openapi-generator-config-server.yaml" \
19
+ --output-directory "out/$targetId/Sources/${projectName}Server" \
20
+ "$openApiFile"
21
+
19
22
  # Copy Package.swift file
20
23
  cp Package.swift out/$targetId
21
24
  sed -i '' "s/__PROJECT_NAME__/$projectName/" out/$targetId/Package.swift
@@ -0,0 +1,5 @@
1
+ generate:
2
+ - types
3
+ - server
4
+ accessModifier: public
5
+ namingStrategy: idiomatic