-
Notifications
You must be signed in to change notification settings - Fork 323
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
noExtraProps flag not working with recursive type #562
Comments
@domoritz what you want to got for following type, when flag Type: type Sub = {
subChild: string;
};
type Main = {
mainChild: Main & Sub;
} if we generating a schema like this: {
"$ref": "#/definitions/Main",
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"Sub": {
"additionalProperties": false,
"type": "object",
"properties": {
"childSub": {
"type": "number"
}
}
},
"Main": {
"additionalProperties": false,
"properties": {
"childMain": {
"allOf": [
{
"$ref": "#/definitions/Main"
},
{
"$ref": "#/definitions/Sub"
}
]
}
},
"required": [
"childMain"
],
"type": "object"
}
}
} so we will got the issue like #107 I middle in write a PR for resolve this issue, but your should to answer of this product question |
@domoritz I tried this case also on vega {
"$ref": "#/definitions/Foo",
"$schema": "http://json-schema.org/draft-04/schema#",
"definitions": {
"Foo": {
"additionalProperties": false,
"properties": {
"childFoo": {
"additionalProperties": false,
"properties": {},
"type": "object"
}
},
"required": [
"childFoo"
],
"type": "object"
}
}
} without recursive. So please help me to decide what we want to be the output for this case. |
@erezmce what you think? |
this type is endless, and no data to be valid for this type. so we not support it. thanks @erezmce |
Facing this as well, any workarounds? I'm ok with having a max-depth option if all else fails? (Mainly prisma types are problematic) |
Steps to Reproduce:
version: 0.59.0
create schema for
Foo
type, and turn on the flagnoExtraProps
.The error:
Maximum call stack size exceeded.
Because we merging the object, instead of use in
allOf
(see #107), in recursive type we trying to build schema for parent and child again and again.The text was updated successfully, but these errors were encountered: