Skip to content

Commit 7c84475

Browse files
committed
Update petstore.yaml with deepObject parameter
1 parent 0e8371f commit 7c84475

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
@@ -1855,6 +1855,31 @@ public enum Operations {
18551855
public typealias feedsPayload = [Operations.listPets.Input.Query.feedsPayloadPayload]
18561856
/// - Remark: Generated from `#/paths/pets/GET/query/feeds`.
18571857
public var feeds: Operations.listPets.Input.Query.feedsPayload?
1858+
/// - Remark: Generated from `#/paths/pets/GET/query/sort`.
1859+
public struct sortPayload: Codable, Hashable, Sendable {
1860+
/// - Remark: Generated from `#/paths/pets/GET/query/sort/id`.
1861+
public var id: Swift.String?
1862+
/// - Remark: Generated from `#/paths/pets/GET/query/sort/name`.
1863+
public var name: Swift.String?
1864+
/// Creates a new `sortPayload`.
1865+
///
1866+
/// - Parameters:
1867+
/// - id:
1868+
/// - name:
1869+
public init(
1870+
id: Swift.String? = nil,
1871+
name: Swift.String? = nil
1872+
) {
1873+
self.id = id
1874+
self.name = name
1875+
}
1876+
public enum CodingKeys: String, CodingKey {
1877+
case id
1878+
case name
1879+
}
1880+
}
1881+
/// - Remark: Generated from `#/paths/pets/GET/query/sort`.
1882+
public var sort: Operations.listPets.Input.Query.sortPayload?
18581883
/// Supply this parameter to filter pets born since the provided date.
18591884
///
18601885
/// - Remark: Generated from `#/paths/pets/GET/query/since`.
@@ -1865,16 +1890,19 @@ public enum Operations {
18651890
/// - limit: How many items to return at one time (max 100)
18661891
/// - habitat:
18671892
/// - feeds:
1893+
/// - sort:
18681894
/// - since: Supply this parameter to filter pets born since the provided date.
18691895
public init(
18701896
limit: Swift.Int32? = nil,
18711897
habitat: Operations.listPets.Input.Query.habitatPayload? = nil,
18721898
feeds: Operations.listPets.Input.Query.feedsPayload? = nil,
1899+
sort: Operations.listPets.Input.Query.sortPayload? = nil,
18731900
since: Components.Parameters.query_period_born_hyphen_since? = nil
18741901
) {
18751902
self.limit = limit
18761903
self.habitat = habitat
18771904
self.feeds = feeds
1905+
self.sort = sort
18781906
self.since = since
18791907
}
18801908
}

0 commit comments

Comments
 (0)