We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
Using a $ref in a anyOf or an affOf in a schema triggers the following error: RangeError: Maximum call stack size exceeded
$ref
anyOf
affOf
RangeError: Maximum call stack size exceeded
const Enjoi = require('enjoi'); const jsonSchema = { allOf: [ { $ref: "#/components/schemas/TestObject" }, { type: 'object', properties: { info: { type: 'string' } } } ] }; const subSchemas = { components:{ schemas: { TestObject:{ additionalProperties: false, type: 'object', properties:{ id: { type: 'number' }, name:{ type: 'string' }, subobject:{ $ref: "#/components/schemas/TestSubObject" }, type:{ type: 'string', enum: [ 'AUDIENCE', 'CAMPAIGN' ] } } }, TestSubObject:{ additionalProperties: false, type: 'object', properties:{ id:{ type: 'number' }, name:{ type: 'string' } } } } } }; const schema = Enjoi.schema(jsonSchema, { subSchemas }); const options = { allowUnknown: false, abortEarly: false, stripUnknown: false }; const result = schema.validate({ id: 7, name: 'test', type: 'AUDIENCE', info: 'good' }, options); console.log('res', result);
The validation should be able to handle $refs in anyOf or allOf
$refs
allOf
Thanks in advance!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
Using a
$ref
in aanyOf
or anaffOf
in a schema triggers the following error:RangeError: Maximum call stack size exceeded
Code to reproduce
Expected result
The validation should be able to handle
$refs
inanyOf
orallOf
Thanks in advance!
The text was updated successfully, but these errors were encountered: