Skip to content

feat: add x-allowReserved support for query parameters in respect#2656

Merged
n0rahh merged 18 commits intomainfrom
feat/support-allow-reserved-option
Mar 18, 2026
Merged

feat: add x-allowReserved support for query parameters in respect#2656
n0rahh merged 18 commits intomainfrom
feat/support-allow-reserved-option

Conversation

@n0rahh
Copy link
Contributor

@n0rahh n0rahh commented Mar 13, 2026

What/Why/How?

What: Support for leaving RFC 3986 reserved characters unencoded in query parameter values when running Respect tests.

  • OpenAPI path: When a step uses an OpenAPI operation, allowReserved from the operation’s query parameters is respected.
  • Arazzo path: When step parameters are defined in the Arazzo description (e.g. with x-operation), the x-allowReserved extension can be used on a parameter, since allowReserved is not part of the Arazzo spec.

Why: Matches Portal Replay behavior: with allowReserved: true / x-allowReserved: true, reserved characters in query values (e.g. : / ? # [ ] @ ! $ & ' ( ) * + , ; =) stay unencoded so URL-like values (e.g. callback URLs) work as intended.

How:

  • OpenAPI: Read allowReserved from operation parameters in get-request-data-from-openapi and pass it through on ParameterWithIn.
  • Arazzo: In step parameters, support the x-allowReserved extension (core type + arazzo schema); in resolveParameters, map x-allowReserved to internal allowReserved.
  • Encoding: Use encodeURIValue(value, allowReserved) in buildQueryString for query values instead of encoding reserved chars everywhere; api-fetcher passes the flag through from parameters.

Reference

resolves https://github.com/Redocly/redocly/issues/21326
docs Redocly/website#269

Testing

Screenshots (optional)

Check yourself

  • Code changed? - Tested with Redoc/Realm/Reunite (internal)
  • All new/updated code is covered by tests
  • New package installed? - Tested in different environments (browser/node)
  • Documentation update considered

Security

  • The security impact of the change has been considered
  • Code follows company security practices and guidelines

@changeset-bot
Copy link

changeset-bot bot commented Mar 13, 2026

🦋 Changeset detected

Latest commit: 4d2a398

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@redocly/openapi-core Minor
@redocly/respect-core Minor
@redocly/cli Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Mar 13, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 79.27% (🎯 79%) 6519 / 8223
🔵 Statements 78.74% (🎯 78%) 6740 / 8559
🔵 Functions 82.82% (🎯 82%) 1331 / 1607
🔵 Branches 71.12% (🎯 71%) 4449 / 6255
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/respect-core/src/arazzo-schema.ts 0% 100% 100% 0% 1-449
packages/respect-core/src/modules/description-parser/get-request-data-from-openapi.ts 91.3% 77.77% 100% 91.3% 79, 88
packages/respect-core/src/modules/flow-runner/prepare-request.ts 89.47% 81.7% 100% 89.18% 81, 132, 194-199, 203-205, 265, 268
packages/respect-core/src/utils/api-fetcher.ts 55.1% 45.37% 73.33% 54.79% 89-95, 125, 151-167, 178-179, 189-192, 197-200, 205, 208-229, 242-255, 263, 310-316, 323-401, 409, 417, 438, 453, 460, 463, 467
packages/respect-core/src/utils/url-encoding.ts 100% 100% 100% 100%
Generated in workflow #9068 for commit 4d2a398 by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

github-actions bot commented Mar 13, 2026

CLI Version Mean Time ± Std Dev (s) Relative Performance (Lower is Faster)
cli-latest 3.474s ± 0.040s ▓ 1.00x (Fastest)
cli-next 3.475s ± 0.032s ▓ 1.00x

@n0rahh n0rahh added the snapshot Create experimental release PR label Mar 16, 2026
@github-actions
Copy link
Contributor

📦 A new experimental 🧪 version v0.0.0-snapshot.1773672987 of Redocly CLI has been published for testing.

Install with NPM:

npm install @redocly/cli@0.0.0-snapshot.1773672987
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1773672987
# or
npm install @redocly/respect-core@0.0.0-snapshot.1773672987

⚠️ Note: This is a development build and may contain unstable features.

@n0rahh n0rahh marked this pull request as ready for review March 16, 2026 15:01
@n0rahh n0rahh requested review from a team as code owners March 16, 2026 15:01
@n0rahh n0rahh requested a review from DmitryAnansky March 18, 2026 09:08
@DmitryAnansky
Copy link
Contributor

Consider adding some documentation for your new extension (check x-security for example).

@DmitryAnansky
Copy link
Contributor

Consider adding some documentation for your new extension (check x-security for example).

cc: @Redocly/technical-writers

@DmitryAnansky
Copy link
Contributor

Could you please also update PR title and description.

@n0rahh n0rahh changed the title feat: add allowReserved support for query parameters in respect feat: add x-allowReserved support for query parameters in respect Mar 18, 2026
@n0rahh n0rahh merged commit 718a02e into main Mar 18, 2026
41 checks passed
@n0rahh n0rahh deleted the feat/support-allow-reserved-option branch March 18, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

snapshot Create experimental release PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants