[Swift] fix(#18074): correctly map OpenAPIDateWithoutTime to string in path#18077
Conversation
feaa405 to
e811b73
Compare
|
CI was right, hope it's fixed now. BTW: Another possible solution would be for OpenAPIDateWithoutTime to implement RawRepresentable and handle RawRepresentable in mapValueToPathItem, too. I'm not sure if either solution is better, though. Also, with useCustomDateWithoutTime = false, paths would still be broken with this patch. But that's no regression and a fix would require Date Formatting. |
|
Hi @kalinjul thanks for creating this PR. |
|
@4brunu : we would still need an additional case here (but for RawRepresentable instead of DateWithoutTime) I'm really not sure which is better. I decided for the solution in this PR, because there are no other custom data types introduced by the generator, so i guessed special treatment for this one would be fair. If you are leaning towards the RawPresentable solution, I'd happily agree and change the PR. |
|
I think the RawPresentable solution would be simpler, what do you think? |
… to string in path
3744cd9 to
e6e5dca
Compare
|
I updated the branch with the RawRepresentable solution. |
|
Sorry, I forgot about this PR. Actually if |
Ok now i forgot about this too, but today i saw our workaround in generated code and remembered :)
I think useCustomDateWithoutTime only applies to
But then a But: Date is a struct, we cannot inherit from it anyways, so that's not a solution. |
|
Thanks for the explanation and the contribution, looks good to me. 👍 |
This fixes #18074, OpenAPIDateWithoutTime handling when a date is part of the uri path (parameter).
There are several options to fix the issue, this is just one suggestion.
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(upcoming 7.1.0 minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)