-
-
Notifications
You must be signed in to change notification settings - Fork 7k
[swift][client] make QueryStringEncodable return any Sendable #21142
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
[swift][client] make QueryStringEncodable return any Sendable #21142
Conversation
This looks like a good fix for the time being, but I do have some ideas for larger changes I want to implement:
So while I agree that the name QueryStringEncodable isn't accurate, I think we can keep it as-is until we have these larger changes. At any rate, JSON is never involved so it's still a better name than the old JSONEncodable. |
Thanks, I would appreciate if you can create smaller PRs, because it's easier to review and I really want to prioritise stabilize the Swift Generator, so I would like not to merge big changes now.
I agreed with that change, but yesterday I noticed that the QueryStringEncodable isn't just used for query parameters, but also for form parameters and header parameters.
JSONEncodable was not the best name, we have two separated processes here. I honestly think that we really need to change the naming to avoid this type of confusion. |
The OpenAPI spec allows it, but currently no version of the generator does this correctly (i.e. in a compliant manner). The current dictionary of My idea is to add a new implementation of Swift's This would definitely not be required for the
Sounds like a good way forward to me. |
In this commit I renamed a few things:
|
Failure doesn't seem to be related to this PR. |
Currently returns a string, but this breaks the FormDataEncoding that is expecting each different type and not all types converted to strings.
This for example break the file upload, because instead of sending the file content to the server, it sends the local file path, because the URL was converted to a String.
This PR fixes #20997 (comment), because it changes the return type from
String
toany Sendable
.With this change, the QueryStringEncodable name seems a bit off, because:
String
any more, it returnsany Sendable
Maybe we should rename QueryStringEncodable to
ParameterEncodable
.EDIT: Looks like
ParameterEncoding
already exists which is similar toParameterEncodable
and can create some confusion. MaybeParameterValueEncodable
?@x-sheep what do you think of this?
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master
(upcoming7.x.0
minor release - breaking changes with fallbacks),8.0.x
(breaking changes without fallbacks)@jgavris (2017/07) @ehyche (2017/08) @Edubits (2017/09) @jaz-ah (2017/09) @4brunu (2019/11) @dydus0x14 (2023/06)