Skip to content

Commit

Permalink
Update petstore.yaml with deepObject parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
kstefanou52 committed Apr 17, 2024
1 parent 7444022 commit 4d6f297
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Tests/OpenAPIGeneratorReferenceTests/Resources/Docs/petstore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,18 @@ paths:
schema:
format: uuid
type: string
- name: sort
in: query
required: false
style: deepObject
explode: true
schema:
type: object
properties:
id:
type: string
name:
type: string
- $ref: '#/components/parameters/query.born-since'
responses:
'200':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ public struct Client: APIProtocol {
name: "My-Request-UUID",
value: input.headers.My_hyphen_Request_hyphen_UUID
)
try converter.setQueryItemAsURI(
in: &request,
style: .deepObject,
explode: true,
name: "sort",
value: input.query.sort
)
try converter.setQueryItemAsURI(
in: &request,
style: .form,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,13 @@ fileprivate extension UniversalServer where APIHandler: APIProtocol {
name: "feeds",
as: Operations.listPets.Input.Query.feedsPayload.self
),
sort: try converter.getOptionalQueryItemAsURI(
in: request.soar_query,
style: .deepObject,
explode: true,
name: "sort",
as: Operations.listPets.Input.Query.sortPayload.self
),
since: try converter.getOptionalQueryItemAsURI(
in: request.soar_query,
style: .form,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1791,6 +1791,31 @@ public enum Operations {
public typealias feedsPayload = [Operations.listPets.Input.Query.feedsPayloadPayload]
/// - Remark: Generated from `#/paths/pets/GET/query/feeds`.
public var feeds: Operations.listPets.Input.Query.feedsPayload?
/// - Remark: Generated from `#/paths/pets/GET/query/sort`.
public struct sortPayload: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/paths/pets/GET/query/sort/id`.
public var id: Swift.String?
/// - Remark: Generated from `#/paths/pets/GET/query/sort/name`.
public var name: Swift.String?
/// Creates a new `sortPayload`.
///
/// - Parameters:
/// - id:
/// - name:
public init(
id: Swift.String? = nil,
name: Swift.String? = nil
) {
self.id = id
self.name = name
}
public enum CodingKeys: String, CodingKey {
case id
case name
}
}
/// - Remark: Generated from `#/paths/pets/GET/query/sort`.
public var sort: Operations.listPets.Input.Query.sortPayload?
/// Supply this parameter to filter pets born since the provided date.
///
/// - Remark: Generated from `#/paths/pets/GET/query/since`.
Expand All @@ -1801,16 +1826,19 @@ public enum Operations {
/// - limit: How many items to return at one time (max 100)
/// - habitat:
/// - feeds:
/// - sort:
/// - since: Supply this parameter to filter pets born since the provided date.
public init(
limit: Swift.Int32? = nil,
habitat: Operations.listPets.Input.Query.habitatPayload? = nil,
feeds: Operations.listPets.Input.Query.feedsPayload? = nil,
sort: Operations.listPets.Input.Query.sortPayload? = nil,
since: Components.Parameters.query_period_born_hyphen_since? = nil
) {
self.limit = limit
self.habitat = habitat
self.feeds = feeds
self.sort = sort
self.since = since
}
}
Expand Down

0 comments on commit 4d6f297

Please sign in to comment.