Skip to content

Commit a408a73

Browse files
committed
Update to 1.2.0
1 parent 9be6af3 commit a408a73

File tree

6 files changed

+32
-166
lines changed

6 files changed

+32
-166
lines changed

MODULE.bazel

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# THIS IS AUTO-GENERATED BY bazel run //:update
2-
module(name = "swift-openapi-generator", version = "1.0.0-alpha.1")
2+
module(name = "swift-openapi-generator", version = "1.2.0")
33

44
load_code = use_extension("//:extensions.bzl", "load_code")
55
use_repo(
@@ -27,6 +27,7 @@ use_repo(
2727
"swiftpkg_swift_algorithms",
2828
"swiftpkg_swift_argument_parser",
2929
"swiftpkg_swift_docc_plugin",
30+
"swiftpkg_swift_http_types",
3031
"swiftpkg_swift_openapi_runtime",
3132
"swiftpkg_yams",
3233
)

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ archive_override(
2626
)
2727
```
2828

29+
Check the release notes for the updated values to put into the snippet above.
30+
2931
### Using the Rule
3032

3133
In the Bazel package where you want to generate the Swift code from OpenAPI specs, add these lines:

extensions.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
44
def _load_code_impl(module_ctx):
55
http_archive(
66
name = "swift-openapi-generator-code",
7-
url = "https://github.com/apple/swift-openapi-generator/archive/refs/tags/1.0.0-alpha.1.tar.gz",
8-
sha256 = "dc79d7779357f387a94f59e55a64cb041c13828a6318b99931f154122f66d600",
9-
strip_prefix = "swift-openapi-generator-1.0.0-alpha.1",
7+
url = "https://github.com/apple/swift-openapi-generator/archive/refs/tags/1.2.0.tar.gz",
8+
sha256 = "1eb0e97d177a5156ada912feec264b5848064c3d60ded1e680ef65c337d84292",
9+
strip_prefix = "swift-openapi-generator-1.2.0",
1010

1111
patches = ["//:internal/swift-openapi-generator.patch"], # Add pre-calculated bazel files to the repo
1212
patch_args = ["-p1"], # Using Git-diff requires stripping the first path

internal/swift-openapi-generator.patch

Lines changed: 12 additions & 151 deletions
Original file line numberDiff line numberDiff line change
@@ -40,150 +40,6 @@ index 0000000..690b968
4040
+ name = "create_build_files",
4141
+ gazelle = ":gazelle_bin",
4242
+)
43-
diff --git a/Examples/GreetingService/Sources/GreetingService/BUILD.bazel b/Examples/GreetingService/Sources/GreetingService/BUILD.bazel
44-
new file mode 100644
45-
index 0000000..1367c56
46-
--- /dev/null
47-
+++ b/Examples/GreetingService/Sources/GreetingService/BUILD.bazel
48-
@@ -0,0 +1,9 @@
49-
+load("@rules_swift//swift:swift.bzl", "swift_binary")
50-
+
51-
+swift_binary(
52-
+ name = "GreetingService",
53-
+ srcs = ["GreetingService.swift"],
54-
+ module_name = "GreetingService",
55-
+ visibility = ["//visibility:public"],
56-
+ deps = ["@swiftpkg_swift_openapi_runtime//:Sources_OpenAPIRuntime"],
57-
+)
58-
diff --git a/Examples/GreetingService/Tests/GreetingServiceMockTests/BUILD.bazel b/Examples/GreetingService/Tests/GreetingServiceMockTests/BUILD.bazel
59-
new file mode 100644
60-
index 0000000..a6d13fc
61-
--- /dev/null
62-
+++ b/Examples/GreetingService/Tests/GreetingServiceMockTests/BUILD.bazel
63-
@@ -0,0 +1,11 @@
64-
+load("@rules_swift//swift:swift.bzl", "swift_test")
65-
+
66-
+swift_test(
67-
+ name = "GreetingServiceMockTests",
68-
+ srcs = [
69-
+ "MockGreetingService.swift",
70-
+ "MockGreetingServiceTests.swift",
71-
+ ],
72-
+ module_name = "GreetingServiceMockTests",
73-
+ deps = ["//Examples/GreetingService/Sources/GreetingService"],
74-
+)
75-
diff --git a/Examples/GreetingServiceClient/Sources/GreetingServiceClient/BUILD.bazel b/Examples/GreetingServiceClient/Sources/GreetingServiceClient/BUILD.bazel
76-
new file mode 100644
77-
index 0000000..fcb5a1f
78-
--- /dev/null
79-
+++ b/Examples/GreetingServiceClient/Sources/GreetingServiceClient/BUILD.bazel
80-
@@ -0,0 +1,9 @@
81-
+load("@rules_swift//swift:swift.bzl", "swift_binary")
82-
+
83-
+swift_binary(
84-
+ name = "GreetingServiceClient",
85-
+ srcs = ["GreetingServiceClient.swift"],
86-
+ module_name = "GreetingServiceClient",
87-
+ visibility = ["//visibility:public"],
88-
+ deps = ["@swiftpkg_swift_openapi_runtime//:Sources_OpenAPIRuntime"],
89-
+)
90-
diff --git a/Examples/GreetingServiceClient/Tests/GreetingServiceMockTests/BUILD.bazel b/Examples/GreetingServiceClient/Tests/GreetingServiceMockTests/BUILD.bazel
91-
new file mode 100644
92-
index 0000000..144d498
93-
--- /dev/null
94-
+++ b/Examples/GreetingServiceClient/Tests/GreetingServiceMockTests/BUILD.bazel
95-
@@ -0,0 +1,11 @@
96-
+load("@rules_swift//swift:swift.bzl", "swift_test")
97-
+
98-
+swift_test(
99-
+ name = "GreetingServiceMockTests",
100-
+ srcs = [
101-
+ "MockGreetingService.swift",
102-
+ "MockGreetingServiceTests.swift",
103-
+ ],
104-
+ module_name = "GreetingServiceMockTests",
105-
+ deps = ["//Examples/GreetingServiceClient/Sources/GreetingServiceClient"],
106-
+)
107-
diff --git a/IntegrationTest/Sources/Client/BUILD.bazel b/IntegrationTest/Sources/Client/BUILD.bazel
108-
new file mode 100644
109-
index 0000000..2e5bbe2
110-
--- /dev/null
111-
+++ b/IntegrationTest/Sources/Client/BUILD.bazel
112-
@@ -0,0 +1,8 @@
113-
+load("@rules_swift//swift:swift.bzl", "swift_library")
114-
+
115-
+swift_library(
116-
+ name = "Client",
117-
+ srcs = ["Empty.swift"],
118-
+ module_name = "Client",
119-
+ visibility = ["//visibility:public"],
120-
+)
121-
diff --git a/IntegrationTest/Sources/MockTransportClient/BUILD.bazel b/IntegrationTest/Sources/MockTransportClient/BUILD.bazel
122-
new file mode 100644
123-
index 0000000..99501ea
124-
--- /dev/null
125-
+++ b/IntegrationTest/Sources/MockTransportClient/BUILD.bazel
126-
@@ -0,0 +1,13 @@
127-
+load("@rules_swift//swift:swift.bzl", "swift_library")
128-
+
129-
+swift_library(
130-
+ name = "MockTransportClient",
131-
+ srcs = ["Client.swift"],
132-
+ module_name = "MockTransportClient",
133-
+ visibility = ["//visibility:public"],
134-
+ deps = [
135-
+ "//IntegrationTest/Sources/Client",
136-
+ "//IntegrationTest/Sources/Types",
137-
+ "@swiftpkg_swift_openapi_runtime//:Sources_OpenAPIRuntime",
138-
+ ],
139-
+)
140-
diff --git a/IntegrationTest/Sources/MockTransportServer/BUILD.bazel b/IntegrationTest/Sources/MockTransportServer/BUILD.bazel
141-
new file mode 100644
142-
index 0000000..4716d60
143-
--- /dev/null
144-
+++ b/IntegrationTest/Sources/MockTransportServer/BUILD.bazel
145-
@@ -0,0 +1,13 @@
146-
+load("@rules_swift//swift:swift.bzl", "swift_library")
147-
+
148-
+swift_library(
149-
+ name = "MockTransportServer",
150-
+ srcs = ["Server.swift"],
151-
+ module_name = "MockTransportServer",
152-
+ visibility = ["//visibility:public"],
153-
+ deps = [
154-
+ "//IntegrationTest/Sources/Server",
155-
+ "//IntegrationTest/Sources/Types",
156-
+ "@swiftpkg_swift_openapi_runtime//:Sources_OpenAPIRuntime",
157-
+ ],
158-
+)
159-
diff --git a/IntegrationTest/Sources/Server/BUILD.bazel b/IntegrationTest/Sources/Server/BUILD.bazel
160-
new file mode 100644
161-
index 0000000..dd8c037
162-
--- /dev/null
163-
+++ b/IntegrationTest/Sources/Server/BUILD.bazel
164-
@@ -0,0 +1,8 @@
165-
+load("@rules_swift//swift:swift.bzl", "swift_library")
166-
+
167-
+swift_library(
168-
+ name = "Server",
169-
+ srcs = ["Empty.swift"],
170-
+ module_name = "Server",
171-
+ visibility = ["//visibility:public"],
172-
+)
173-
diff --git a/IntegrationTest/Sources/Types/BUILD.bazel b/IntegrationTest/Sources/Types/BUILD.bazel
174-
new file mode 100644
175-
index 0000000..dccba42
176-
--- /dev/null
177-
+++ b/IntegrationTest/Sources/Types/BUILD.bazel
178-
@@ -0,0 +1,8 @@
179-
+load("@rules_swift//swift:swift.bzl", "swift_library")
180-
+
181-
+swift_library(
182-
+ name = "Types",
183-
+ srcs = ["Empty.swift"],
184-
+ module_name = "Types",
185-
+ visibility = ["//visibility:public"],
186-
+)
18743
diff --git a/Plugins/OpenAPIGenerator/BUILD.bazel b/Plugins/OpenAPIGenerator/BUILD.bazel
18844
new file mode 100644
18945
index 0000000..80c770f
@@ -231,10 +87,10 @@ index 0000000..6f45956
23187
+)
23288
diff --git a/Sources/PetstoreConsumerTestCore/BUILD.bazel b/Sources/PetstoreConsumerTestCore/BUILD.bazel
23389
new file mode 100644
234-
index 0000000..22d7b4e
90+
index 0000000..5e01524
23591
--- /dev/null
23692
+++ b/Sources/PetstoreConsumerTestCore/BUILD.bazel
237-
@@ -0,0 +1,14 @@
93+
@@ -0,0 +1,17 @@
23894
+load("@rules_swift//swift:swift.bzl", "swift_library")
23995
+
24096
+swift_library(
@@ -247,7 +103,10 @@ index 0000000..22d7b4e
247103
+ ],
248104
+ module_name = "PetstoreConsumerTestCore",
249105
+ visibility = ["//visibility:public"],
250-
+ deps = ["@swiftpkg_swift_openapi_runtime//:Sources_OpenAPIRuntime"],
106+
+ deps = [
107+
+ "@swiftpkg_swift_http_types//:Sources_HTTPTypes",
108+
+ "@swiftpkg_swift_openapi_runtime//:Sources_OpenAPIRuntime",
109+
+ ],
251110
+)
252111
diff --git a/Sources/_OpenAPIGeneratorCore/BUILD.bazel b/Sources/_OpenAPIGeneratorCore/BUILD.bazel
253112
new file mode 100644
@@ -429,10 +288,10 @@ index 0000000..8eaffd7
429288
+)
430289
diff --git a/Tests/OpenAPIGeneratorReferenceTests/BUILD.bazel b/Tests/OpenAPIGeneratorReferenceTests/BUILD.bazel
431290
new file mode 100644
432-
index 0000000..9fc8868
291+
index 0000000..92de772
433292
--- /dev/null
434293
+++ b/Tests/OpenAPIGeneratorReferenceTests/BUILD.bazel
435-
@@ -0,0 +1,20 @@
294+
@@ -0,0 +1,21 @@
436295
+load("@rules_swift//swift:swift.bzl", "swift_test")
437296
+
438297
+swift_test(
@@ -449,16 +308,17 @@ index 0000000..9fc8868
449308
+ module_name = "OpenAPIGeneratorReferenceTests",
450309
+ deps = [
451310
+ "@swiftpkg_openapikit//:Sources_OpenAPIKitCompat",
311+
+ "@swiftpkg_swift_http_types//:Sources_HTTPTypes",
452312
+ "@swiftpkg_swift_openapi_runtime//:Sources_OpenAPIRuntime",
453313
+ "@swiftpkg_yams//:Sources_Yams",
454314
+ ],
455315
+)
456316
diff --git a/Tests/PetstoreConsumerTests/BUILD.bazel b/Tests/PetstoreConsumerTests/BUILD.bazel
457317
new file mode 100644
458-
index 0000000..c870a2f
318+
index 0000000..be589f9
459319
--- /dev/null
460320
+++ b/Tests/PetstoreConsumerTests/BUILD.bazel
461-
@@ -0,0 +1,20 @@
321+
@@ -0,0 +1,21 @@
462322
+load("@rules_swift//swift:swift.bzl", "swift_library")
463323
+
464324
+swift_library(
@@ -476,6 +336,7 @@ index 0000000..c870a2f
476336
+ visibility = ["//visibility:public"],
477337
+ deps = [
478338
+ "//Sources/PetstoreConsumerTestCore",
339+
+ "@swiftpkg_swift_http_types//:Sources_HTTPTypes",
479340
+ "@swiftpkg_swift_openapi_runtime//:Sources_OpenAPIRuntime",
480341
+ ],
481342
+)

internal/update.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ tar -xzf archive.tar.gz
7575
rm archive.tar.gz
7676
cd "swift-openapi-generator-${VERSION}"
7777
git init &>/dev/null # git init usually prints a message
78+
rm -rf Examples IntegrationTest
7879
git add .
7980
git commit -m "Base commit" &>/dev/null
8081
touch WORKSPACE

swift_deps_index.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"swift-algorithms",
55
"swift-argument-parser",
66
"swift-docc-plugin",
7+
"swift-http-types",
78
"swift-openapi-runtime",
89
"yams"
910
],
@@ -388,9 +389,9 @@
388389
"name": "swiftpkg_openapikit",
389390
"identity": "openapikit",
390391
"remote": {
391-
"commit": "b00b08d05e6fba0e156c06be3332b9774e172afd",
392-
"remote": "https://github.com/mattpolzin/OpenAPIKit.git",
393-
"version": "3.1.1"
392+
"commit": "283454875cc6e5b2801d184d65835b92252d1784",
393+
"remote": "https://github.com/mattpolzin/OpenAPIKit",
394+
"version": "3.1.2"
394395
}
395396
},
396397
{
@@ -406,9 +407,9 @@
406407
"name": "swiftpkg_swift_argument_parser",
407408
"identity": "swift-argument-parser",
408409
"remote": {
409-
"commit": "8f4d2753f0e4778c76d5f05ad16c74f707390531",
410-
"remote": "https://github.com/apple/swift-argument-parser.git",
411-
"version": "1.2.3"
410+
"commit": "c8ed701b513cf5177118a175d85fbbbcd707ab41",
411+
"remote": "https://github.com/apple/swift-argument-parser",
412+
"version": "1.3.0"
412413
}
413414
},
414415
{
@@ -433,9 +434,9 @@
433434
"name": "swiftpkg_swift_http_types",
434435
"identity": "swift-http-types",
435436
"remote": {
436-
"commit": "1827dc94bdab2eb5f2fc804e9b0cb43574282566",
437+
"commit": "12358d55a3824bd5fed310b999ea8cf83a9a1a65",
437438
"remote": "https://github.com/apple/swift-http-types",
438-
"version": "1.0.2"
439+
"version": "1.0.3"
439440
}
440441
},
441442
{
@@ -451,17 +452,17 @@
451452
"name": "swiftpkg_swift_openapi_runtime",
452453
"identity": "swift-openapi-runtime",
453454
"remote": {
454-
"commit": "7d1644b125c02be1bedcfe1a69b58fae881b2393",
455+
"commit": "76951d77a0609599d2dc233e7e40808a74767c6a",
455456
"remote": "https://github.com/apple/swift-openapi-runtime",
456-
"version": "1.0.0-alpha.1"
457+
"version": "1.3.2"
457458
}
458459
},
459460
{
460461
"name": "swiftpkg_yams",
461462
"identity": "yams",
462463
"remote": {
463464
"commit": "0d9ee7ea8c4ebd4a489ad7a73d5c6cad55d6fed3",
464-
"remote": "https://github.com/jpsim/Yams.git",
465+
"remote": "https://github.com/jpsim/Yams",
465466
"version": "5.0.6"
466467
}
467468
}

0 commit comments

Comments
 (0)