Skip to content

Commit 4d6f297

Browse files
committed
Update petstore.yaml with deepObject parameter
1 parent 7444022 commit 4d6f297

File tree

4 files changed

+54
-0
lines changed

4 files changed

+54
-0
lines changed

Tests/OpenAPIGeneratorReferenceTests/Resources/Docs/petstore.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,18 @@ paths:
6969
schema:
7070
format: uuid
7171
type: string
72+
- name: sort
73+
in: query
74+
required: false
75+
style: deepObject
76+
explode: true
77+
schema:
78+
type: object
79+
properties:
80+
id:
81+
type: string
82+
name:
83+
type: string
7284
- $ref: '#/components/parameters/query.born-since'
7385
responses:
7486
'200':

Tests/OpenAPIGeneratorReferenceTests/Resources/ReferenceSources/Petstore/Client.swift

+7
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ public struct Client: APIProtocol {
8787
name: "My-Request-UUID",
8888
value: input.headers.My_hyphen_Request_hyphen_UUID
8989
)
90+
try converter.setQueryItemAsURI(
91+
in: &request,
92+
style: .deepObject,
93+
explode: true,
94+
name: "sort",
95+
value: input.query.sort
96+
)
9097
try converter.setQueryItemAsURI(
9198
in: &request,
9299
style: .form,

Tests/OpenAPIGeneratorReferenceTests/Resources/ReferenceSources/Petstore/Server.swift

+7
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,13 @@ fileprivate extension UniversalServer where APIHandler: APIProtocol {
187187
name: "feeds",
188188
as: Operations.listPets.Input.Query.feedsPayload.self
189189
),
190+
sort: try converter.getOptionalQueryItemAsURI(
191+
in: request.soar_query,
192+
style: .deepObject,
193+
explode: true,
194+
name: "sort",
195+
as: Operations.listPets.Input.Query.sortPayload.self
196+
),
190197
since: try converter.getOptionalQueryItemAsURI(
191198
in: request.soar_query,
192199
style: .form,

Tests/OpenAPIGeneratorReferenceTests/Resources/ReferenceSources/Petstore/Types.swift

+28
Original file line numberDiff line numberDiff line change
@@ -1791,6 +1791,31 @@ public enum Operations {
17911791
public typealias feedsPayload = [Operations.listPets.Input.Query.feedsPayloadPayload]
17921792
/// - Remark: Generated from `#/paths/pets/GET/query/feeds`.
17931793
public var feeds: Operations.listPets.Input.Query.feedsPayload?
1794+
/// - Remark: Generated from `#/paths/pets/GET/query/sort`.
1795+
public struct sortPayload: Codable, Hashable, Sendable {
1796+
/// - Remark: Generated from `#/paths/pets/GET/query/sort/id`.
1797+
public var id: Swift.String?
1798+
/// - Remark: Generated from `#/paths/pets/GET/query/sort/name`.
1799+
public var name: Swift.String?
1800+
/// Creates a new `sortPayload`.
1801+
///
1802+
/// - Parameters:
1803+
/// - id:
1804+
/// - name:
1805+
public init(
1806+
id: Swift.String? = nil,
1807+
name: Swift.String? = nil
1808+
) {
1809+
self.id = id
1810+
self.name = name
1811+
}
1812+
public enum CodingKeys: String, CodingKey {
1813+
case id
1814+
case name
1815+
}
1816+
}
1817+
/// - Remark: Generated from `#/paths/pets/GET/query/sort`.
1818+
public var sort: Operations.listPets.Input.Query.sortPayload?
17941819
/// Supply this parameter to filter pets born since the provided date.
17951820
///
17961821
/// - Remark: Generated from `#/paths/pets/GET/query/since`.
@@ -1801,16 +1826,19 @@ public enum Operations {
18011826
/// - limit: How many items to return at one time (max 100)
18021827
/// - habitat:
18031828
/// - feeds:
1829+
/// - sort:
18041830
/// - since: Supply this parameter to filter pets born since the provided date.
18051831
public init(
18061832
limit: Swift.Int32? = nil,
18071833
habitat: Operations.listPets.Input.Query.habitatPayload? = nil,
18081834
feeds: Operations.listPets.Input.Query.feedsPayload? = nil,
1835+
sort: Operations.listPets.Input.Query.sortPayload? = nil,
18091836
since: Components.Parameters.query_period_born_hyphen_since? = nil
18101837
) {
18111838
self.limit = limit
18121839
self.habitat = habitat
18131840
self.feeds = feeds
1841+
self.sort = sort
18141842
self.since = since
18151843
}
18161844
}

0 commit comments

Comments
 (0)