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

RangeError: Maximum call stack size exceeded #55

Closed barry-m closed 4 years ago

barry-m commented 5 years ago

Using a large YAML file (6,305 lines, 198K), however it fails searching for schema located at the end of the paths section. I ran the yaml through another validator to verify the format was correct, validated fine. Data validation worked fine until I added the last path and schema definitions then problem started to occur. Attached are openapi 3.0 schema, and text file w/error message.

RangeError-MaxCallStack.txt openapi.yaml.zip

barry-m commented 5 years ago

Code snippet at point of failure:

expect(res.status).to.equal(200); const body = await res.json(); const _validator = validator.validateResponse('get', /channels/{channelUuid}/physicians/{physicianUuid}) expect(_validator({ headers: res.headers, body: body, statusCode: res.status, statusCodeNum: res.statusCodeNum })).to.be.undefined

barry-m commented 5 years ago

Sorry. Found a circular reference w/a different schema validator. Not an issue