Closed jeanfrancois8512 closed 8 months ago
I am fairly convinced that https://github.com/APIDevTools/json-schema-ref-parser/pull/169 fixes this issue.
I have the same issue with the below openapi
. i'am using v9.0.6 version it contains the #169 fix
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
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'
(node:17) UnhandledPromiseRejectionWarning: RangeError: Maximum call stack size exceeded
at crawl (/usr/lib/node_modules/openapi-examples-validator/node_modules/@apidevtools/json-schema-ref-parser/lib/resolve-external.js:54:16)
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)
at crawl (/usr/lib/node_modules/openapi-examples-validator/node_modules/@apidevtools/json-schema-ref-parser/lib/resolve-external.js:70:38)
Can you folks try out 9.0.9 and see if that's fixed it?
Hi, I'm not sure this is a bug with this library, the library that does the call, or my schema.
here the stack trace:
The file to be validated by ibm-openapi-validator:
and the referenced schema: