Skip to content
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] Support unexploded query items #171

Merged
merged 4 commits into from
Aug 8, 2023

Conversation

czechboy0
Copy link
Contributor

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.

Copy link
Contributor

@glbrntt glbrntt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I can tell, this all looks good. It might be worth getting some eyes with more knowledge of this project to look as well 👀

@czechboy0
Copy link
Contributor Author

Thanks for the review, @glbrntt, could you also take a look at the associated runtime PR please? apple/swift-openapi-runtime#35

@czechboy0 czechboy0 merged commit 0ae57b9 into apple:main Aug 8, 2023
@czechboy0 czechboy0 deleted the hd-unexploded-query-items branch August 8, 2023 08:07
@czechboy0 czechboy0 added the 🔨 semver/patch No public API change. label Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature "Unexploded query params" is not supported.
2 participants