-
-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot pass definitions field when using openapi configuration #691
Comments
imjuni
added a commit
to imjuni/fastify-swagger
that referenced
this issue
Nov 16, 2022
* fix cannot pass externalSchemas when using openapi configuration
imjuni
added a commit
to imjuni/fastify-swagger
that referenced
this issue
Nov 16, 2022
* fix cannot pass externalSchemas when using openapi configuration
imjuni
added a commit
to imjuni/fastify-swagger
that referenced
this issue
Nov 17, 2022
* fix cannot pass externalSchemas when using openapi configuration
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prerequisites
Fastify version
4.9.2
Plugin version
8.1.0
Node.js version
14.20.1
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
Ubuntu 20.04.3 LTS
Description
Issue
Cannot found $ref schema when custom SchemaController apply on fastify server instance.
@fastify/swagger
display error message like that,Custom SchemaController
ajv schema store split from fastify server instance because schema store use other case. eg. redis, rabbitmq pub/sub or file upload etc(share $ref schema).
Analysis
definitions
field remove from the option so that changeopenapiObject.definitions
toopenapiObject.components.schemas
definitions
is alwaysundefined
so no way to pass externalSchemas2. resolveLocalRef function not search root scope.* fastify document explain to
$ref as a root reference
* but
resolveLocalRef
function don't search root scope. Only search inline scope.Steps to Reproduce
Reproducable Repo.
Use this repo.
git clone [email protected]:imjuni/maeum.git
cd maeum
npm install
npm run dev
Expected Behavior
Works with custom schemaController.
The text was updated successfully, but these errors were encountered: