Repository navigation
Add JSON query parameter conversion helpers - #215
Merged
Merged
Conversation
czechboy0
self-requested a review
September 28, 2026 09:36
czechboy0
enabled auto-merge (squash)
October 6, 2026 08:25
czechboy0
added a commit
to apple/swift-openapi-generator
that referenced
this pull request
Oct 6, 2026
### Motivation The generator already emits JSON query helper calls. This change covers those calls with reference and consumer tests for issue [#853](#853). ### Modifications Add a required inline parameter snippet test and an optional referenced JSON query parameter to Petstore. Update the generated references, compiled client and server tests, and conversion documentation. ### Result The tests cover both required and optional generated calls, including the JSON query value sent and received by Petstore. ### Test Plan `swift build` and the full default `swift test` suite passed locally with the runtime fork as a local dependency: 334 tests reported, 0 failures, 18 skipped. The 17 opt-in compatibility tests also passed. Related runtime PR: apple/swift-openapi-runtime#215 Closes #853 --------- Co-authored-by: Honza Dvorsky <honza@apple.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Generator issue #853 produces calls for JSON query parameters, but the runtime does not provide the matching helpers.
Modifications
Add client and optional and required server helpers that encode a JSON value as one named query item. Keep the generated
styleandexplodearguments for compatibility. Use a dedicated compact JSON encoder with sorted keys, unescaped slashes, and the configured date transcoder.Result
Generated clients and servers can encode and decode
content: application/jsonquery parameters. Missing required parameters retain the existing error behavior.Test Plan
swift buildand the fullswift testsuite passed locally: 239 tests, 0 failures.Related generator PR: apple/swift-openapi-generator#956