Skip to content

Commit c0402fe

Browse files
authored
Update compat suite OpenAPI documents to their latest versions (#418)
### Motivation Update the docs used by the compat suite, to be representative for 1.0. ### Modifications Updated to the latest versions of all docs. ### Result Using the latest versions. ### Test Plan CI passed (both generation and building), and locally I ran both GitHubs, as they don't build in CI even in the full pipeline.
1 parent 12f9219 commit c0402fe

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

Tests/OpenAPIGeneratorReferenceTests/CompatabilityTest.swift

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ final class CompatibilityTest: XCTestCase {
5555

5656
func testBox() async throws {
5757
try await _test(
58-
"https://raw.githubusercontent.com/box/box-openapi/5955d651f0cd273c0968e3855c1d873c7ae3523e/openapi.json",
58+
"https://raw.githubusercontent.com/box/box-openapi/98f51911398fb3f997b2ce0666f11f37065fc4c9/openapi.json",
5959
license: .apache,
6060
expectedDiagnostics: [
6161
"Multipart request bodies must always be required, but found an optional one - skipping. Mark as `required: true` to get this body generated.",
@@ -76,7 +76,7 @@ final class CompatibilityTest: XCTestCase {
7676

7777
func testCloudHypervisor() async throws {
7878
try await _test(
79-
"https://raw.githubusercontent.com/cloud-hypervisor/cloud-hypervisor/889d06277acae45c2b55bd5f6298ca2b21a55cbb/vmm/src/api/openapi/cloud-hypervisor.yaml",
79+
"https://raw.githubusercontent.com/cloud-hypervisor/cloud-hypervisor/2b457584e06fb72c0256433141731750c58eb6b5/vmm/src/api/openapi/cloud-hypervisor.yaml",
8080
license: .apache,
8181
expectedDiagnostics: [],
8282
skipBuild: compatibilityTestSkipBuild
@@ -85,7 +85,7 @@ final class CompatibilityTest: XCTestCase {
8585

8686
func testDiscourse() async throws {
8787
try await _test(
88-
"https://raw.githubusercontent.com/discourse/discourse_api_docs/aa152ea188c7b07bbf809681154cc311ec178acf/openapi.yml",
88+
"https://raw.githubusercontent.com/discourse/discourse_api_docs/fa2391353e9c3eb016ccae30daa34467d2ac2616/openapi.yml",
8989
license: .apache,
9090
expectedDiagnostics: [
9191
"Validation warning: Inconsistency encountered when parsing `OpenAPI Schema`: Found nothing but unsupported attributes..",
@@ -97,30 +97,42 @@ final class CompatibilityTest: XCTestCase {
9797

9898
func testGithub() async throws {
9999
try await _test(
100-
"https://raw.githubusercontent.com/github/rest-api-description/13c873cb3b15ffd5bcd88c6d6270a963ef4518f6/descriptions/api.github.com/api.github.com.yaml",
100+
"https://raw.githubusercontent.com/github/rest-api-description/322663c9c909974af16363b4dc0873c428bdbe34/descriptions-next/api.github.com/api.github.com.yaml",
101101
license: .mit,
102102
expectedDiagnostics: [
103-
"A property name only appears in the required list, but not in the properties map - this is likely a typo; skipping this property."
103+
"Validation warning: Inconsistency encountered when parsing `OpenAPI Schema`: Found schema attributes not consistent with the type specified: array. Specifically, attributes for these other types: [\"object\"].",
104+
"Validation warning: Inconsistency encountered when parsing `OpenAPI Schema`: Found schema attributes not consistent with the type specified: string. Specifically, attributes for these other types: [\"object\"].",
105+
"Validation warning: Inconsistency encountered when parsing `OpenAPI Schema`: Found nothing but unsupported attributes..",
106+
"Schema warning: Inconsistency encountered when parsing `OpenAPI Schema`: Found schema attributes not consistent with the type specified: string. Specifically, attributes for these other types: [\"array\"].",
107+
"Validation warning: Inconsistency encountered when parsing `Schema`: A schema contains properties for multiple types of schemas, namely: [\"array\", \"object\"]..",
108+
"Validation warning: Inconsistency encountered when parsing `OpenAPI Schema`: Found schema attributes not consistent with the type specified: string. Specifically, attributes for these other types: [\"array\"].",
109+
"A property name only appears in the required list, but not in the properties map - this is likely a typo; skipping this property.",
110+
"Schema warning: Inconsistency encountered when parsing `OpenAPI Schema`: Found schema attributes not consistent with the type specified: array. Specifically, attributes for these other types: [\"object\"].",
111+
"Schema warning: Inconsistency encountered when parsing `Schema`: A schema contains properties for multiple types of schemas, namely: [\"array\", \"object\"]..",
104112
],
105113
skipBuild: true
106114
)
107115
}
108116

109117
func testGithubEnterprise() async throws {
110118
try await _test(
111-
"https://raw.githubusercontent.com/github/rest-api-description/13c873cb3b15ffd5bcd88c6d6270a963ef4518f6/descriptions/ghes-3.5/ghes-3.5.yaml",
119+
"https://raw.githubusercontent.com/github/rest-api-description/322663c9c909974af16363b4dc0873c428bdbe34/descriptions-next/ghes-3.7/ghes-3.7.yaml",
112120
license: .mit,
113121
expectedDiagnostics: [
114122
"Multipart request bodies must always be required, but found an optional one - skipping. Mark as `required: true` to get this body generated.",
123+
"Validation warning: Inconsistency encountered when parsing `OpenAPI Schema`: Found nothing but unsupported attributes..",
124+
"Validation warning: Inconsistency encountered when parsing `OpenAPI Schema`: Found schema attributes not consistent with the type specified: string. Specifically, attributes for these other types: [\"array\"].",
115125
"A property name only appears in the required list, but not in the properties map - this is likely a typo; skipping this property.",
126+
"Validation warning: Inconsistency encountered when parsing `OpenAPI Schema`: Found schema attributes not consistent with the type specified: string. Specifically, attributes for these other types: [\"object\"].",
127+
"Schema warning: Inconsistency encountered when parsing `OpenAPI Schema`: Found schema attributes not consistent with the type specified: string. Specifically, attributes for these other types: [\"array\"].",
116128
],
117129
skipBuild: true
118130
)
119131
}
120132

121133
func testKubernetes() async throws {
122134
try await _test(
123-
"https://raw.githubusercontent.com/kubernetes/kubernetes/fa3d7990104d7c1f16943a67f11b154b71f6a132/api/openapi-spec/v3/api__v1_openapi.json",
135+
"https://raw.githubusercontent.com/kubernetes/kubernetes/599fdb7adde5658dadb6a149c40624b4342fc909/api/openapi-spec/v3/api__v1_openapi.json",
124136
license: .apache,
125137
expectedDiagnostics: [],
126138
skipBuild: compatibilityTestSkipBuild
@@ -140,9 +152,11 @@ final class CompatibilityTest: XCTestCase {
140152

141153
func testOpenAI() async throws {
142154
try await _test(
143-
"https://raw.githubusercontent.com/openai/openai-openapi/ec0b3953bfa08a92782bdccf34c1931b13402f56/openapi.yaml",
155+
"https://raw.githubusercontent.com/openai/openai-openapi/75eebb4477355ddb3abe18615108e02cf6fdca42/openapi.yaml",
144156
license: .mit,
145-
expectedDiagnostics: [],
157+
expectedDiagnostics: [
158+
"A property name only appears in the required list, but not in the properties map - this is likely a typo; skipping this property."
159+
],
146160
skipBuild: compatibilityTestSkipBuild
147161
)
148162
}
@@ -164,6 +178,7 @@ final class CompatibilityTest: XCTestCase {
164178
skipBuild: compatibilityTestSkipBuild
165179
)
166180
}
181+
167182
func testOpenAPIExamplesAPIWithExamples() async throws {
168183
try await _test(
169184
"https://raw.githubusercontent.com/OAI/OpenAPI-Specification/9dff244e5708fbe16e768738f4f17cf3fddf4066/examples/v3.0/api-with-examples.yaml",
@@ -172,6 +187,7 @@ final class CompatibilityTest: XCTestCase {
172187
skipBuild: compatibilityTestSkipBuild
173188
)
174189
}
190+
175191
func testOpenAPIExamplesCallbackExample() async throws {
176192
try await _test(
177193
"https://raw.githubusercontent.com/OAI/OpenAPI-Specification/9dff244e5708fbe16e768738f4f17cf3fddf4066/examples/v3.0/callback-example.yaml",
@@ -180,6 +196,7 @@ final class CompatibilityTest: XCTestCase {
180196
skipBuild: compatibilityTestSkipBuild
181197
)
182198
}
199+
183200
func testOpenAPIExamplesLinkExample() async throws {
184201
try await _test(
185202
"https://raw.githubusercontent.com/OAI/OpenAPI-Specification/9dff244e5708fbe16e768738f4f17cf3fddf4066/examples/v3.0/link-example.yaml",

0 commit comments

Comments
 (0)