Skip to content

Commit f432b58

Browse files
Merge branch 'main' into sb/avoid-clashing-with-property-names
2 parents 4fd3eac + 61ec6b6 commit f432b58

File tree

68 files changed

+2255
-439
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+2255
-439
lines changed

.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
end_of_line = lf
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true

.github/workflows/main.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Main
2+
3+
on:
4+
push:
5+
branches: [main]
6+
schedule:
7+
- cron: "0 8,20 * * *"
8+
9+
jobs:
10+
unit-tests:
11+
name: Unit tests
12+
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
13+
with:
14+
linux_5_9_arguments_override: "--explicit-target-dependency-import-check error"
15+
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
16+
linux_6_0_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
17+
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error"
18+
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
19+
20+
integration-test:
21+
name: Integration test
22+
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
23+
with:
24+
name: "Integration test"
25+
matrix_linux_command: "apt-get update -yq && apt-get install -yq jq && SWIFT_OPENAPI_GENERATOR_REPO_URL=file://${GITHUB_WORKSPACE} ./scripts/run-integration-test.sh"
26+
27+
example-packages:
28+
name: Example packages
29+
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
30+
with:
31+
name: "Example packages"
32+
matrix_linux_command: "./scripts/test-examples.sh"

.github/workflows/pull_request.yml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,19 @@ on:
77
jobs:
88
soundness:
99
name: Soundness
10-
uses: apple/swift-nio/.github/workflows/soundness.yml@main
10+
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
1111
with:
12-
api_breakage_check_enabled: true
13-
broken_symlink_check_enabled: true
14-
docs_check_enabled: true
15-
format_check_enabled: true
16-
license_header_check_enabled: true
12+
api_breakage_check_enabled: false
1713
license_header_check_project_name: "SwiftOpenAPIGenerator"
18-
shell_check_enabled: true
19-
unacceptable_language_check_enabled: true
14+
yamllint_check_enabled: false
2015

2116
unit-tests:
2217
name: Unit tests
2318
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
2419
with:
25-
linux_5_8_enabled: false
2620
linux_5_9_arguments_override: "--explicit-target-dependency-import-check error"
2721
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
22+
linux_6_0_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
2823
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error"
2924
linux_nightly_main_enabled: false
3025

@@ -34,7 +29,6 @@ jobs:
3429
with:
3530
name: "Integration test"
3631
matrix_linux_command: "apt-get update -yq && apt-get install -yq jq && SWIFT_OPENAPI_GENERATOR_REPO_URL=file://${GITHUB_WORKSPACE} ./scripts/run-integration-test.sh"
37-
matrix_linux_5_8_enabled: false
3832
matrix_linux_nightly_main_enabled: false
3933

4034
compatibility-test:
@@ -62,10 +56,4 @@ jobs:
6256
with:
6357
name: "Example packages"
6458
matrix_linux_command: "./scripts/test-examples.sh"
65-
matrix_linux_5_8_enabled: false
6659
matrix_linux_nightly_main_enabled: false
67-
68-
swift-6-language-mode:
69-
name: Swift 6 Language Mode
70-
uses: apple/swift-nio/.github/workflows/swift_6_language_mode.yml@main
71-
if: false # Disabled for now.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: PR label
2+
3+
on:
4+
pull_request:
5+
types: [labeled, unlabeled, opened, reopened, synchronize]
6+
7+
jobs:
8+
semver-label-check:
9+
name: Semantic version label check
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 1
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
with:
16+
persist-credentials: false
17+
- name: Check for Semantic Version label
18+
uses: apple/swift-nio/.github/actions/pull_request_semver_label_checker@main

.github/workflows/scheduled.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.licenseignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,5 @@ Examples/HelloWorldiOSClientAppExample/HelloWorldiOSClientApp/Assets.xcassets/*
3838
Examples/HelloWorldiOSClientAppExample/HelloWorldiOSClientApp/Preview*
3939
Examples/**/Generated*
4040
**/Makefile
41-
**/*.html
41+
**/*.html
42+
.editorconfig

Examples/manual-generation-generator-cli-example/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# The following values can be changed here, or passed on the command line.
66
SWIFT_OPENAPI_GENERATOR_GIT_URL ?= https://github.com/apple/swift-openapi-generator
7-
SWIFT_OPENAPI_GENERATOR_GIT_TAG ?= 1.0.0
7+
SWIFT_OPENAPI_GENERATOR_GIT_TAG ?= 1.5.0
88
SWIFT_OPENAPI_GENERATOR_CLONE_DIR ?= $(CURRENT_MAKEFILE_DIR)/.swift-openapi-generator
99
SWIFT_OPENAPI_GENERATOR_BUILD_CONFIGURATION ?= debug
1010
OPENAPI_YAML_PATH ?= $(CURRENT_MAKEFILE_DIR)/openapi.yaml

Examples/manual-generation-generator-cli-example/Sources/ManualGeneratorInvocationClient/Generated/Client.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ internal struct Client: APIProtocol {
9393
default:
9494
return .undocumented(
9595
statusCode: response.status.code,
96-
.init()
96+
.init(
97+
headerFields: response.headerFields,
98+
body: responseBody
99+
)
97100
)
98101
}
99102
}

Examples/manual-generation-generator-cli-example/Sources/ManualGeneratorInvocationClient/Generated/Types.swift

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,17 @@ extension APIProtocol {
3434
/// Server URLs defined in the OpenAPI document.
3535
internal enum Servers {
3636
/// Example service deployment.
37+
internal enum Server1 {
38+
/// Example service deployment.
39+
internal static func url() throws -> Foundation.URL {
40+
try Foundation.URL(
41+
validatingOpenAPIServerURL: "https://example.com/api",
42+
variables: []
43+
)
44+
}
45+
}
46+
/// Example service deployment.
47+
@available(*, deprecated, renamed: "Servers.Server1.url")
3748
internal static func server1() throws -> Foundation.URL {
3849
try Foundation.URL(
3950
validatingOpenAPIServerURL: "https://example.com/api",
@@ -123,10 +134,10 @@ internal enum Operations {
123134
self.headers = headers
124135
}
125136
}
126-
@frozen internal enum Output: Sendable, Hashable {
137+
internal enum Output: Sendable, Hashable {
127138
internal struct Ok: Sendable, Hashable {
128139
/// - Remark: Generated from `#/paths/greet/GET/responses/200/content`.
129-
@frozen internal enum Body: Sendable, Hashable {
140+
internal enum Body: Sendable, Hashable {
130141
/// - Remark: Generated from `#/paths/greet/GET/responses/200/content/application\/json`.
131142
case json(Components.Schemas.Greeting)
132143
/// The associated value of the enum case if `self` is `.json`.
@@ -180,7 +191,7 @@ internal enum Operations {
180191
/// A response with a code that is not documented in the OpenAPI document.
181192
case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload)
182193
}
183-
@frozen internal enum AcceptableContentType: AcceptableProtocol {
194+
internal enum AcceptableContentType: AcceptableProtocol {
184195
case json
185196
case other(Swift.String)
186197
internal init?(rawValue: Swift.String) {

Examples/manual-generation-package-plugin-example/Sources/CommandPluginInvocationClient/GeneratedSources/Client.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import struct Foundation.Data
1010
import struct Foundation.Date
1111
#endif
1212
import HTTPTypes
13-
package struct Client: APIProtocol {
13+
internal struct Client: APIProtocol {
1414
/// The underlying HTTP client.
1515
private let client: UniversalClient
1616
/// Creates a new client.
@@ -21,7 +21,7 @@ package struct Client: APIProtocol {
2121
/// - configuration: A set of configuration values for the client.
2222
/// - transport: A transport that performs HTTP operations.
2323
/// - middlewares: A list of middlewares to call before the transport.
24-
package init(
24+
internal init(
2525
serverURL: Foundation.URL,
2626
configuration: Configuration = .init(),
2727
transport: any ClientTransport,
@@ -39,7 +39,7 @@ package struct Client: APIProtocol {
3939
}
4040
/// - Remark: HTTP `GET /greet`.
4141
/// - Remark: Generated from `#/paths//greet/get(getGreeting)`.
42-
package func getGreeting(_ input: Operations.getGreeting.Input) async throws -> Operations.getGreeting.Output {
42+
internal func getGreeting(_ input: Operations.getGreeting.Input) async throws -> Operations.getGreeting.Output {
4343
try await client.send(
4444
input: input,
4545
forOperation: Operations.getGreeting.id,
@@ -93,7 +93,10 @@ package struct Client: APIProtocol {
9393
default:
9494
return .undocumented(
9595
statusCode: response.status.code,
96-
.init()
96+
.init(
97+
headerFields: response.headerFields,
98+
body: responseBody
99+
)
97100
)
98101
}
99102
}

0 commit comments

Comments
 (0)