fastify/help

Dependant Schema keyword

ShaunF253 opened this issue · 1 comments

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.

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.