-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Generator] Add support of deepObject style in query params #538
base: main
Are you sure you want to change the base?
Changes from all commits
368d569
0e8371f
7c84475
adfa77e
acd6984
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please make one of them required, just to test both |
||
- $ref: '#/components/parameters/query.born-since' | ||
responses: | ||
'200': | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2514,6 +2514,18 @@ final class SnippetBasedReferenceTests: XCTestCase { | |
type: array | ||
items: | ||
type: string | ||
- name: sort | ||
in: query | ||
required: false | ||
style: deepObject | ||
explode: true | ||
schema: | ||
type: object | ||
properties: | ||
option1: | ||
type: string | ||
option2: | ||
type: string | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add one more parameter here, one that is required and has one of the object properties required as well. I want to see that the default parameter is working correctly below. |
||
responses: | ||
default: | ||
description: Response | ||
|
@@ -2524,18 +2536,36 @@ final class SnippetBasedReferenceTests: XCTestCase { | |
public var single: Swift.String? | ||
public var manyExploded: [Swift.String]? | ||
public var manyUnexploded: [Swift.String]? | ||
public struct sortPayload: Codable, Hashable, Sendable { | ||
public var option1: Swift.String? | ||
public var option2: Swift.String? | ||
public init( | ||
option1: Swift.String? = nil, | ||
option2: Swift.String? = nil | ||
) { | ||
self.option1 = option1 | ||
self.option2 = option2 | ||
} | ||
public enum CodingKeys: String, CodingKey { | ||
case option1 | ||
case option2 | ||
} | ||
} | ||
public var sort: Operations.get_sol_foo.Input.Query.sortPayload | ||
public init( | ||
single: Swift.String? = nil, | ||
manyExploded: [Swift.String]? = nil, | ||
manyUnexploded: [Swift.String]? = nil | ||
manyUnexploded: [Swift.String]? = nil, | ||
sort: Operations.get_sol_foo.Input.Query.sortPayload | ||
) { | ||
self.single = single | ||
self.manyExploded = manyExploded | ||
self.manyUnexploded = manyUnexploded | ||
self.sort = sort | ||
} | ||
} | ||
public var query: Operations.get_sol_foo.Input.Query | ||
public init(query: Operations.get_sol_foo.Input.Query = .init()) { | ||
public init(query: Operations.get_sol_foo.Input.Query) { | ||
self.query = query | ||
} | ||
} | ||
|
@@ -2572,6 +2602,13 @@ final class SnippetBasedReferenceTests: XCTestCase { | |
name: "manyUnexploded", | ||
value: input.query.manyUnexploded | ||
) | ||
try converter.setQueryItemAsURI( | ||
in: &request, | ||
style: .deepObject, | ||
explode: true, | ||
name: "sort", | ||
value: input.query.sort | ||
) | ||
return (request, nil) | ||
} | ||
""", | ||
|
@@ -2598,6 +2635,13 @@ final class SnippetBasedReferenceTests: XCTestCase { | |
explode: false, | ||
name: "manyUnexploded", | ||
as: [Swift.String].self | ||
), | ||
sort: try converter.getRequiredQueryItemAsURI( | ||
in: request.soar_query, | ||
style: .deepObject, | ||
explode: true, | ||
name: "sort", | ||
as: Operations.get_sol_foo.Input.Query.sortPayload.self | ||
) | ||
) | ||
return Operations.get_sol_foo.Input(query: query) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please bump this to 1.7.0 now