PayU / openapi-validator-middleware

Input validation using Swagger (Open API) and ajv
Apache License 2.0
144 stars 50 forks source link

Throws error when a schema contains reference to external file #134

Closed shahar240 closed 4 years ago

shahar240 commented 4 years ago

since opening schema allows added references to external files over HTTP with $ref the validator should allow loading schemes that use this feature.

currently the init function throws "TypeError: Cannot convert undefined or null to object" if the schema contains external references.

this can be solved by adding async init function that use "apiSchemaBuilder.buildSchema" instead of "apiSchemaBuilder.buildSchemaSync"

shahar240 commented 4 years ago

fixed in 2e61a72 by adding initAsync