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

Response validation always passed when the schema has circular/recursive $ref #48

Open mjbrisebois opened 5 years ago

mjbrisebois commented 5 years ago

Any schema that has a circular reference causes the response to pass every time. The circular reference is not in the required list so it is a valid schema. Even if the schema has a circular reference in the required list, the response validation should fail on the missing reference at some level.

There is an example of recursive references in this OAI/OpenAPI-Specification issue https://github.com/OAI/OpenAPI-Specification/issues/822.