Skip to content

Dependant Schema keyword #1029

@ShaunF253

Description

@ShaunF253

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions