fastify / fastify/help

Dependant Schema keyword

Open
#1,029 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
68
Forks
8
Avg merge
11h 2m
Merged PRs (30d)
2

Description

#### 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](https://github.com/fastify/fluent-json-schema) 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,](https://github.com/fastify/fastify-type-provider-json-schema-to-ts) 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.**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.