Skip to content

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