fix: soft fail fallback response description lookups#832
Merged
mcollina merged 1 commit intofastify:masterfrom Oct 30, 2024
Merged
fix: soft fail fallback response description lookups#832mcollina merged 1 commit intofastify:masterfrom
mcollina merged 1 commit intofastify:masterfrom
Conversation
463f679 to
3d2acfd
Compare
Contributor
Author
|
Hey @gurgunday would you mind merging and releasing a patch version for this package? I would love to cut a new release of my package, pinning the safe version for my consumers. Please and thank you! 🙏 |
2 tasks
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.
I tried fixing this issue in my library as raised in samchungy/fastify-zod-openapi#172
My library dynamically generates
$refs for users so they don't need to register anything upfront and plops them into the components section at the end.As an example, my users will fill in the following:
The
transformhook will output:I tried dynamically injecting the components in the
transformhook and even when I tried adding components into the fastifySwagger constructor this seems to not work.This function does not seem to reference openapi components:
fastify-swagger/lib/util/resolve-schema-reference.js
Lines 3 to 18 in 36a543c
Additionally this line in particular:
fastify-swagger/lib/util/resolve-schema-reference.js
Line 7 in 36a543c
only returns
schemas.I might revisit this repo to add proper openapi component support and start incrementally adding components to the
openapiObjectconstruct but for now I want to unblock my users.Checklist
npm run testandnpm run benchmarkand the Code of conduct