-
Notifications
You must be signed in to change notification settings - Fork 129
Feature "Unexploded query params" is not supported. #52
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
Feature "Unexploded query params" is not supported. #52
Comments
Hi @barnard-b, thanks for reporting this! Indeed, We would definitely appreciate a PR! To learn more about contributing, check out these docs: https://swiftpackageindex.com/apple/swift-openapi-generator/0.1.0/documentation/swift-openapi-generator/contributing-to-swift-openapi-generator And if you have any questions, don't hesitate to tag me here 🙂 |
Note that #48 will be landing in a few hours, and it affects the code you'd be looking into, so I suggest you wait for it to land first. I can give you some pointers later. In the meantime, it would be useful to write up, here in a comment, examples of the cases you'd like to add support for, and how it'd change the generated code. That's usually a good first step. |
[Runtime] Support unexploded query items ### Motivation Fixes apple/swift-openapi-generator#52. By default, query items are encoded as exploded (`key=value1&key=value2`), but OpenAPI allows explicitly requesting them unexploded (`key=value1,value2`). This feature missing has shown up in a few OpenAPI documents recently. ### Modifications Add support for unexploded query items by expanding the helper functions and allow passing in `style` and `explode` parameters. The `style` is in preparation of also supporting alternative styles, but for now we just validate that only the supported style is provided. ### Result Generated code can use these improved helper functions to encode/decode unexploded query items. ### Test Plan Updated/added unit tests for unexploded query items. Reviewed by: glbrntt Builds: ✔︎ pull request validation (5.8) - Build finished. ✔︎ pull request validation (5.9) - Build finished. ✔︎ pull request validation (api breakage) - Build finished. ✔︎ pull request validation (docc test) - Build finished. ✔︎ pull request validation (integration test) - Build finished. ✔︎ pull request validation (nightly) - Build finished. ✔︎ pull request validation (soundness) - Build finished. #35
[Generator] Support unexploded query items ### Motivation Depends on apple/swift-openapi-runtime#35. Fixes #52. By default, query items are encoded as exploded (`key=value1&key=value2`), but OpenAPI allows explicitly requesting them unexploded (`key=value1,value2`). This feature missing has shown up in a few OpenAPI documents recently. ### Modifications Adapt the generator to provide the two new `style` and `explode` parameters to query item encoding/decoding functions. ### Result We now support unexploded query items. ### Test Plan Expanded snippet-based tests to allow generating not just types, but also parts of the client/server. This has allowed us to not have to expand file-based reference tests here. Reviewed by: glbrntt Builds: ✔︎ pull request validation (5.8) - Build finished. ✔︎ pull request validation (5.9) - Build finished. ✔︎ pull request validation (docc test) - Build finished. ✔︎ pull request validation (integration test) - Build finished. ✔︎ pull request validation (nightly) - Build finished. ✔︎ pull request validation (soundness) - Build finished. #171
This will be released shortly in 0.1.8. |
Using an Open API file that has a parameter with
explode: false
results in a warning offalse
values appear to be listed as unsupported in the documentation.I am open to creating a PR, but this is my first time using Open API and would need guidance.
The text was updated successfully, but these errors were encountered: