Skip to content

feat(client): support allowReserved path parameters - #102

Merged
lightsofapollo merged 2 commits into
mainfrom
fix/path-reserved-artifacts
Oct 6, 2026
Merged

lightsofapollo merged 2 commits into
mainfrom
fix/path-reserved-artifacts

Conversation

@lightsofapollo

Copy link
Copy Markdown
Contributor

Summary

Path parameters declaring allowReserved: true now preserve reserved characters such as the colon in XLON:LLOY, rather than sending %3A to 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_struct and generate_operation_methods APIs call an undefined reserved path encoder when a path parameter sets allowReserved: 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 allowReserved as 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

Validation

  • Added a regression that compiles both generated clients and executes the encoder against reserved characters, delimiters, percent triples, malformed percent escapes, and Unicode.
  • Added coverage for selected-operation helper emission and the documented 3.0/3.1/3.2 behavior.
  • cargo fmt --check
  • cargo clippy --all-features -- -D warnings
  • cargo nextest run --all-features (726 passed, 7 skipped)
  • cargo test --doc --all-features
  • RUSTDOCFLAGS=-Dwarnings cargo doc --no-deps --all-features
  • scripts/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 in tests/path_allow_reserved_test.rs.

Beads: openapi-generator-ujw.

gilesw and others added 2 commits October 6, 2026 05:02
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.
@vercel

vercel Bot commented Oct 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openapi-to-rust Ready Ready Preview Oct 6, 2026 4:27am UTC

Request Review

@lightsofapollo
lightsofapollo merged commit 330a487 into main Oct 6, 2026
@lightsofapollo
lightsofapollo deleted the fix/path-reserved-artifacts branch October 6, 2026 04:59

This branch was successfully deployed

1 active deployment
Preview — da5abe50 Deployed Oct 6, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants