Skip to content

Commit adfa77e

Browse files
committed
Add Unite tests for DeepObject.
1 parent 7c84475 commit adfa77e

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ let package = Package(
6060
// Tests-only: Runtime library linked by generated code, and also
6161
// helps keep the runtime library new enough to work with the generated
6262
// code.
63-
.package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.4.0"),
63+
.package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.5.0"),
6464
.package(url: "https://github.com/apple/swift-http-types", from: "1.0.2"),
6565
],
6666
targets: [

Sources/_OpenAPIGeneratorCore/Translator/Parameters/TypedParameter.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ extension FileTranslator {
131131
switch location {
132132
case .query:
133133
switch style {
134-
case .form, .deepObject:
134+
case .form:
135+
break
136+
case .deepObject where explode:
135137
break
136138
default:
137139
try diagnostics.emitUnsupported(

Tests/PetstoreConsumerTests/Test_Client.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ final class Test_Client: XCTestCase {
4040
XCTAssertEqual(operationID, "listPets")
4141
XCTAssertEqual(
4242
request.path,
43-
"/pets?limit=24&habitat=water&feeds=herbivore&feeds=carnivore&since=2023-01-18T10%3A04%3A11Z"
43+
"/pets?limit=24&habitat=water&feeds=herbivore&feeds=carnivore&sort%5Bid%5D=ascending&sort%5Bname%5D=descending&since=2023-01-18T10%3A04%3A11Z"
4444
)
4545
XCTAssertEqual(baseURL.absoluteString, "/api")
4646
XCTAssertEqual(request.method, .get)
@@ -66,7 +66,7 @@ final class Test_Client: XCTestCase {
6666
}
6767
let response = try await client.listPets(
6868
.init(
69-
query: .init(limit: 24, habitat: .water, feeds: [.herbivore, .carnivore], since: .test),
69+
query: .init(limit: 24, habitat: .water, feeds: [.herbivore, .carnivore], sort: .init(id: "ascending", name: "descending"), since: .test),
7070
headers: .init(My_hyphen_Request_hyphen_UUID: "abcd-1234")
7171
)
7272
)

Tests/PetstoreConsumerTests/Test_Server.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ final class Test_Server: XCTestCase {
3333
XCTAssertEqual(input.query.habitat, .water)
3434
XCTAssertEqual(input.query.since, .test)
3535
XCTAssertEqual(input.query.feeds, [.carnivore, .herbivore])
36+
XCTAssertEqual(input.query.sort, .init(id: "ascending", name: "descending"))
3637
XCTAssertEqual(input.headers.My_hyphen_Request_hyphen_UUID, "abcd-1234")
3738
return .ok(
3839
.init(
@@ -43,7 +44,7 @@ final class Test_Server: XCTestCase {
4344
})
4445
let (response, responseBody) = try await server.listPets(
4546
.init(
46-
soar_path: "/api/pets?limit=24&habitat=water&feeds=carnivore&feeds=herbivore&since=\(Date.testString)",
47+
soar_path: "/api/pets?sort%5Bid%5D=ascending&sort%5Bname%5D=descending",
4748
method: .get,
4849
headerFields: [.init("My-Request-UUID")!: "abcd-1234"]
4950
),

0 commit comments

Comments
 (0)