Skip to content

fix(plugin): prioritize static paths over parametric in Postman binding - #1520

Merged
sserrata merged 2 commits into
mainfrom
fix/static-path-ordering-1519
Jun 24, 2026
Merged

sserrata merged 2 commits into
mainfrom
fix/static-path-ordering-1519

Conversation

@sserrata

Copy link
Copy Markdown
Member

Summary

Closes #1519

  • Sort apiMatchers in bindCollectionToApiItems() so static paths are tested before parametric ones, preventing greedy regex from stealing matches when static paths (e.g. /pet/findByTags) are declared after parametric siblings (e.g. /pet/{petId})
  • Add CJS stubs for ESM-only dependencies (chalk v5, @apidevtools/json-schema-ref-parser, @redocly/openapi-core) to fix pre-existing Jest test suite failures
  • Add unit test reproducing the exact Plugin fails to construct URL when static path values goes after parametric #1519 scenario and demo spec for visual regression testing

Test plan

  • All 9 test suites pass (83/83 tests), including new path ordering test
  • Visually verified all 3 demo pages (findByStatus, getPetById, findByTags) show correct URLs in endpoint bar and code samples
  • Confirmed findByTags page no longer shows base URL only (the reported bug)
  • Confirmed getPetById page no longer shows findByTags path (the secondary bug)

🤖 Generated with Claude Code

…ng (#1519)

When static path segments (e.g. `/pet/findByTags`) were declared after
parametric paths (e.g. `/pet/{petId}`) in the OpenAPI spec, the greedy
regex for the parametric path matched the static path first, causing
wrong or missing URLs in code samples and the request panel.

Sort apiMatchers so static paths are tested before parametric ones,
mirroring standard HTTP router behavior. Also fix pre-existing Jest ESM
compatibility issues (chalk v5, @apidevtools/json-schema-ref-parser,
@redocly/openapi-core) by adding CJS stubs.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@github-actions

Copy link
Copy Markdown

Size Change: +4.62 kB (+0.2%)

Total Size: 2.32 MB

📦 View Changed
Filename Size Change
demo/.docusaurus/globalData.json 77.4 kB +636 B (+0.83%)
demo/.docusaurus/registry.js 112 kB +899 B (+0.81%)
demo/.docusaurus/routes.js 106 kB +900 B (+0.86%)
demo/.docusaurus/routesChunkNames.json 44 kB +372 B (+0.85%)
demo/build/assets/js/main.********.js 686 kB +1.62 kB (+0.24%)
demo/build/assets/js/runtime~main.********.js 25.5 kB +198 B (+0.78%)
ℹ️ View Unchanged
Filename Size
demo/.docusaurus/codeTranslations.json 2 B
demo/.docusaurus/docusaurus.config.mjs 16.4 kB
demo/.docusaurus/i18n.json 372 B
demo/.docusaurus/site-metadata.json 1.58 kB
demo/build/assets/css/styles.********.css 173 kB
demo/build/index.html 99.5 kB
demo/build/petstore/add-pet/index.html 30 kB
demo/build/petstore/create-user/index.html 24.7 kB
demo/build/petstore/create-users-with-array-input/index.html 24.8 kB
demo/build/petstore/create-users-with-list-input/index.html 24.8 kB
demo/build/petstore/delete-order/index.html 24.5 kB
demo/build/petstore/delete-pet/index.html 24.8 kB
demo/build/petstore/delete-user/index.html 25 kB
demo/build/petstore/find-pets-by-status/index.html 25.5 kB
demo/build/petstore/find-pets-by-tags/index.html 26.2 kB
demo/build/petstore/get-inventory/index.html 23.8 kB
demo/build/petstore/get-order-by-id/index.html 24.8 kB
demo/build/petstore/get-pet-by-id/index.html 25.6 kB
demo/build/petstore/get-user-by-name/index.html 25.1 kB
demo/build/petstore/login-user/index.html 25.6 kB
demo/build/petstore/logout-user/index.html 24.4 kB
demo/build/petstore/new-pet/index.html 25 kB
demo/build/petstore/pet/index.html 23.2 kB
demo/build/petstore/place-order/index.html 24 kB
demo/build/petstore/schemas/apiresponse/index.html 25.2 kB
demo/build/petstore/schemas/cat/index.html 39.1 kB
demo/build/petstore/schemas/category/index.html 26.3 kB
demo/build/petstore/schemas/dog/index.html 39.3 kB
demo/build/petstore/schemas/honeybee/index.html 39.4 kB
demo/build/petstore/schemas/id/index.html 23.4 kB
demo/build/petstore/schemas/order/index.html 27.4 kB
demo/build/petstore/schemas/pet/index.html 38.9 kB
demo/build/petstore/schemas/tag/index.html 24.7 kB
demo/build/petstore/schemas/user/index.html 40.8 kB
demo/build/petstore/store/index.html 22.2 kB
demo/build/petstore/subscribe-to-the-store-events/index.html 30.9 kB
demo/build/petstore/swagger-petstore-yaml/index.html 30.9 kB
demo/build/petstore/update-pet-with-form/index.html 25 kB
demo/build/petstore/update-pet/index.html 25.4 kB
demo/build/petstore/update-user/index.html 25 kB
demo/build/petstore/upload-file/index.html 24.8 kB
demo/build/petstore/user/index.html 22.9 kB

compressed-size-action

The v0.10.0 release uses Node 20 runtime, which GitHub Actions deprecated
on 2026-06-02. Pin to unreleased commit 500ac62 that bumps to Node 24
(FirebaseExtended/action-hosting-deploy#450). Also removes the invalid
totalPreviewChannelLimit input and the now-redundant
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 env var.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@github-actions

github-actions Bot commented Jun 24, 2026 •

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit c505551):

https://docusaurus-openapi-36b86--pr1520-x89s3i9l.web.app

(expires Wed, 01 Jul 2026 16:50:29 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: bf293780ee827f578864d92193b8c2866acd459f

@sserrata sserrata closed this Jun 24, 2026
@sserrata sserrata reopened this Jun 24, 2026
@sserrata sserrata closed this Jun 24, 2026
@sserrata sserrata reopened this Jun 24, 2026
@sserrata
sserrata merged commit e2f01f7 into main Jun 24, 2026
30 of 36 checks passed
@sserrata
sserrata deleted the fix/static-path-ordering-1519 branch June 24, 2026 17:02

This branch was previously deployed

1 inactive deployment
preview — c5055518 Deployed Jun 24, 2026 by sserrata via Deploy #2219
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.

Plugin fails to construct URL when static path values goes after parametric

1 participant