You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i'am using the openapi-examples-validator (4.2.0) to validate a openapi spec yaml that contains a recursive object.
i got this error below a example openapi document
(node:19) UnhandledPromiseRejectionWarning: RangeError: Maximum call stack size exceeded
at Function.keys (<anonymous>)
at crawl (/usr/lib/node_modules/openapi-examples-validator/node_modules/@apidevtools/json-schema-ref-parser/lib/resolve-external.js:62:30)
at crawl (/usr/lib/node_modules/openapi-examples-validator/node_modules/@apidevtools/json-schema-ref-parser/lib/resolve-external.js:70:38)
at crawl (/usr/lib/node_modules/openapi-examples-validator/node_modules/@apidevtools/json-schema-ref-parser/lib/resolve-external.js:70:38)
at crawl (/usr/lib/node_modules/openapi-examples-validator/node_modules/@apidevtools/json-schema-ref-parser/lib/resolve-external.js:70:38)
at crawl (/usr/lib/node_modules/openapi-examples-validator/node_modules/@apidevtools/json-schema-ref-parser/lib/resolve-external.js:70:38)
at crawl (/usr/lib/node_modules/openapi-examples-validator/node_modules/@apidevtools/json-schema-ref-parser/lib/resolve-external.js:70:38)
at crawl (/usr/lib/node_modules/openapi-examples-validator/node_modules/@apidevtools/json-schema-ref-parser/lib/resolve-external.js:70:38)
at crawl (/usr/lib/node_modules/openapi-examples-validator/node_modules/@apidevtools/json-schema-ref-parser/lib/resolve-external.js:70:38)
at crawl (/usr/lib/node_modules/openapi-examples-validator/node_modules/@apidevtools/json-schema-ref-parser/lib/resolve-external.js:70:38)
(node:19) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)
(node:19) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
openapi: 3.0.3
info:
version: 1.0.0
title: recurive-api
paths:
/categories:
get:
tags:
- categories
operationId: listCategories
responses:
200:
description: List of categories retrieved Successfully
content:
'application/json':
schema:
$ref: '#/components/schemas/Node'
components:
schemas:
Node:
title: Node
description: This is a recursive element and can hold categories, sub-categories and products
type: object
properties:
nodes:
type: array
items:
$ref: '#/components/schemas/Node'
The text was updated successfully, but these errors were encountered:
Yes. In the current implementation that's not going to work because before the validation starts the spec is dereferenced and in this case it ends up in an infinite recursion. I have to check if there's an easy way to solve this.
The only way I see to resolve this is to not dereference it in this case but instead keeping the reference pointer in the JSON-schema but then I'd have that circular reference that ajv can't handle.
Hello
i'am using the openapi-examples-validator (4.2.0) to validate a openapi spec yaml that contains a recursive object.
i got this error below a example
openapi
documentThe text was updated successfully, but these errors were encountered: