[Swift] Add option parameter to select response queue#4591
[Swift] Add option parameter to select response queue#4591wing328 merged 6 commits intoOpenAPITools:masterfrom yosshi4486:response-queue
Conversation
|
This is nice, because it maintains backwards compatibility and it's configurable. |
Run ./bin/swift4-all.sh then remove unrelated diff.
| public static var credential: URLCredential? | ||
| public static var customHeaders: [String:String] = [:] | ||
| public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() | ||
| public static var queue: DispatchQueue = .main |
There was a problem hiding this comment.
@syatyo what do you think of giving this a more specific name?
Something like APIResponseQueue or something like that.
It's just to avoid confusion in case more configurable queue's are added in the future.
There was a problem hiding this comment.
Variable names in swift start with lowercase, so maybe something like apiResponseQueue?
There was a problem hiding this comment.
It seems better! I will try it.
Rename queue to apiResponseQueue, because apiResponseQueue is more clear for explaining the context.
|
Thanks for the changes, for me it looks good 🙂 |
|
@syatyo thanks for the PR. Can you please resolve the merge conflicts when you've time? |
| public static var credential: URLCredential? | ||
| public static var customHeaders: [String:String] = [:] | ||
| public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() | ||
| public static var apiResponseQueue: DispatchQueue = .main |
There was a problem hiding this comment.
@syatyo Since now the Swift generator support the visibility modifier, this line should become
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var apiResponseQueue: DispatchQueue = .main
|
@wing328 Thanks for resolving conflics! |
|
@syatyo thanks for the PR, which has been included in the v4.2.2 release: https://twitter.com/oas_generator/status/1201432648544972800 |
Description of the PR
Proposed feature for [REQ] [Swift] Select response queue
@jgavris @ehyche @Edubits @jaz-ah @d-date
close #4590
PR checklist
./bin/(or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run./bin/{LANG}-petstore.sh,./bin/openapi3/{LANG}-petstore.shif updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).master,4.3.x,5.0.x. Default:master.