-
-
Notifications
You must be signed in to change notification settings - Fork 199
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 find reference with allOf #540
Comments
The problem exist because of how Lines 385 to 484 in 68f7b69
I don't think it can be fixed in a short time, the problem here lead to a complicated use-case. cc @ivan-tymoshenko Do you have a time to investigate this issue? |
As a workaround, I suggest you to change the schema as follow. {
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "Test",
"definitions": {
"Problem": {
"type": "object",
"required": [
"type"
],
"additionalProperties": true,
"properties": {
"type": {
"type": "string"
}
}
},
"ValidationFragment": {
"type": "string"
},
"ValidationErrorProblem": {
"type": "object",
"allOf": [
{
"$ref": "#/definitions/Problem"
},
{
"type": "object",
"properties": {
"validation": {
// all nested schema reference by $id
"$ref": "Test#/definitions/ValidationFragment"
}
}
}
]
}
},
"additionalProperties": false,
"type": "object"
} |
Thanks a lot for your quick answer and the workaround ! |
Prerequisites
Fastify version
4.5.3
Plugin version
5.3.0
Node.js version
16
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
12.2
Description
I suspect it comes from fastify/fastify#4049 shipped with fastify 4.2.0 but I cannot figure what is wrong with my case.
It used to work with fastify 4.1.0 .
Maybe you have a clue.
Steps to Reproduce
Schema is :
Code is
Error is :
Expected Behavior
It used to work with fastify 4.1.0. I would expect FJS to compile the schema.
The text was updated successfully, but these errors were encountered: