Repository navigation
feat(client): support allowReserved path parameters - #102
Merged
Merged
Conversation
A path parameter with allowReserved: true now serializes with RFC 6570 reserved expansion: ':' '@' '[' ']' and the sub-delimiters stay literal and existing %XX triples pass through, while '/', '?' and '#' stay percent-encoded as OpenAPI path templating requires. Default path encoding is unchanged. Some servers route on the literal form: Ticker.app answers 404 to GET /prices/XLON%3ALLOY and 200 to GET /prices/XLON:LLOY.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Summary
Path parameters declaring
allowReserved: truenow preserve reserved characters such as the colon inXLON:LLOY, rather than sending%3Ato servers that route on the literal identifier. Existing percent-encoded triples pass through;/,?, and#remain encoded. Default path encoding is unchanged.The follow-up also fixes helper emission: clients assembled with the public
generate_http_client_structandgenerate_operation_methodsAPIs call an undefined reserved path encoder when a path parameter setsallowReserved: true. Emit that helper with the operation artifacts so low-level composition and full-client generation both compile, while selective clients include it only when needed.Document path
allowReservedas OpenAPI 3.2 behavior and an explicit compatibility extension in 3.0/3.1. This branch starts at #101 (9d48041), preserves the original author’s commit, and adds the review fixes. Because #101 comes from a fork, this PR targets main so the original feature and fixes can land together. Supersedes #101 once merged.Generated compatibility
allowReserved: truechange encoding, as described in feat(client): honour allowReserved on path parameters #101. Full-client corpus output remains identical to feat(client): honour allowReserved on path parameters #101; the follow-up only adds the required private helper to low-level operation output.allowReservedremains unsupported, now documented explicitly.Validation
cargo fmt --checkcargo clippy --all-features -- -D warningscargo nextest run --all-features(726 passed, 7 skipped)cargo test --doc --all-featuresRUSTDOCFLAGS=-Dwarnings cargo doc --no-deps --all-featuresscripts/corpus-manifest.sh --check(56 specs, 224 files; no additional output changes beyond feat(client): honour allowReserved on path parameters #101)scripts/spec-compile.sh anthropic openai(both compiled and passed round trips)Notes for reviewers
The original feature is the first commit; the follow-up fix is the second. For the fix, start with the helper moving into
generate_operation_methods_for, then the generated-client compilation regression intests/path_allow_reserved_test.rs.Beads:
openapi-generator-ujw.