Fix "Reference not found" error when filtering by tags with path-level parameters#3677
Draft
Fix "Reference not found" error when filtering by tags with path-level parameters#3677
Conversation
|
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Copilot
AI
changed the title
[WIP] Fix filtering by tags resulting in an error
Fix "Reference not found" error when filtering by tags with path-level parameters
Apr 2, 2026
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.
When using
parser.filters.tagswithorphans: false, operations on paths that defineparametersat the path-item level (rather than on individual operations) would crash withError: Reference not found: #/components/parameters/<name>.Root cause
Two bugs in the filtering pipeline:
buildResourceMetadataonly collected transitive dependencies from an operation's own subtree. Path-item–levelparametersare siblings of operations in the spec tree, so they were invisible to the orphan analysis and subsequently removed fromcomponents.parameters.filterSpecremoved a path item only when it was completely empty (!Object.keys(pathItem).length). A path item with all HTTP-method operations filtered out but aparameterskey remaining was kept inspec.paths, referencing now-deleted component parameters.Changes
packages/shared/src/openApi/shared/graph/meta.ts— when building an operation's dependency set, also traverse#/paths/<path>/parameters(the sibling parameters array) so path-item–level$refparameters are counted as operation dependencies and survive orphan pruning.packages/shared/src/openApi/{2.0.x,3.0.x,3.1.x}/parser/filter.ts— replace the path-item removal guard:This removes path items whenever no HTTP-method operations remain, regardless of other keys (e.g.
parameters,summary).specs/3.0.x/filter-path-parameters.yaml+ test case in3.0.x.test.ts— reproduces the reported scenario: two tagged resource groups (pets,owners), each with path-item–level$refparameters, filtered to a single tag withorphans: false.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
fonts.googleapis.com/opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node /home/REDACTED/work/openapi-ts/openapi-ts/node_modules/.pnpm/next@15.2.4_react-dom@19.0.0_react@19.0.0__react@19.0.0_sass@1.97.1/node_modules/next/dist/compiled/jest-worker/processChild.js clients/@hey-api--noEmit clients/@hey-api/client-nuxt/base-url-string/client/index.ts ode_modules/.bin/../vite/bin/vite.js clients/@hey-api/client-nuxt/base-url-string/client/client.gen.ts clients/@hey-api/client-nuxt/base-url-string/client/types.gen.ts napi-ts/packages/json-schema-ref-parser/node_modules/.bin/node clients/@hey-apinode clients/@hey-api/home/REDACTED/work/openapi-ts/openapi-ts/examples/openapi-ts-next/nod�� clients/@hey-apibuild clients/@hey-api/client-nuxt/clenode16 de/n�� clients/@hey-api/client-nuxt/cle. clients/@hey-api/client-nuxt/clean-false/core/pathSerializer.gen.ts ules/.bin/sh clients/@hey-apigetconf clients/@hey-apiGNU_LIBC_VERSION(dns block)If you need me to access, download, or install something from one of these locations, you can either: