Skip to content
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

Dependant Schema keyword #1029

Open
ShaunF253 opened this issue May 29, 2024 · 1 comment
Open

Dependant Schema keyword #1029

ShaunF253 opened this issue May 29, 2024 · 1 comment

Comments

@ShaunF253
Copy link

ShaunF253 commented May 29, 2024

You have already researched for similar issues?

Yes, searching brought me to this https://github.com/fastify/fluent-json-schema repo.

What are you trying to achieve, or the steps to reproduce?

I came across this package when searching for a fix to using the dependentSchemas keyword with Fastify.

My issue is that I'm seeing an error relating to this and can't find any docs/examples on how to use this.

Confusingly as well I'm not sure how this package fits into the Fastify ecosystem. I see no reference to this package in our node modules.

We're using the json schema type provider, which can be configured using ajv and to include the format and keyword package. Doing this however I still saw the same issue. In short I could do with an example on how to achieve this or clear up confusion around how to solve this error.

We are attempting to generate an open api spec by invoking the .swagger() method on the fastify instance.

What was the result you received?

FastifyError [Error]: Failed building the validation schema for POST: /XXXXXXXXXXX, due to error strict mode: unknown keyword: "dependentSchemas"

What did you expect?

Open api spec to be valid/generated with this keyword.

Context

  • node version: v20.13.0
  • fastify version: 4.27.0

Please read this entire template before posting any issue. If you ignore these instructions
and post an issue here that does not follow the instructions, your issue might be closed,
locked, and assigned the missing discussion label.

@mcollina
Copy link
Member

Thanks for reporting!

Can you provide steps to reproduce? We often need a reproducible example, e.g. some code that allows someone else to recreate your problem by just copying and pasting it. If it involves more than a couple of different file, create a new repository on GitHub and add a link to that.

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

No branches or pull requests

2 participants