Hilzu / express-openapi-validate

Express middleware to validate requests based on an OpenAPI 3 document
Apache License 2.0
75 stars 12 forks source link

oas with circular reference #80

Open kshavva opened 1 year ago

kshavva commented 1 year ago

Hello, i have a problem:

my openapi spec has circular reference, so i am getting Maximum call stack size exceeded because of it in walkSchema function of schema-utils.js.

Is there a way to make express-openapi-validate work with oas with circular reference?

i have something like this:

Characteristic:
  type: object
  description: Provides the value of a given characteristic
  required:
    - name
  properties:
    id:
      type: string
      description: Unique identifier of the characteristic
    name:
      type: string
      description: Name of the characteristic
    nested:
      type: array
      items:
        $ref: '#/components/schemas/Characteristics'

Characteristics:
  type: array
  items:
    $ref: '#/components/schemas/Characteristic'