open-api
open-api copied to clipboard
Incorrect type for componentSchemas in OpenAPIRequestValidator
Hello,
the componentSchemas
field in OpenAPIRequestValidator
is declared as:
componentSchemas?: IJsonSchema[];
But looking to the tests, you are always passing an object instead of an array. When I pass an object it works fine, but if I pass the schemas as array it fails to resolve references, with an error like:
Error: can't resolve reference #/components/schemas/TestItem from id #
Is it an idea to change the type to something like:
componentSchemas?: {[key: string]: OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject;}
Hi @jsdevel , perhaps you have an opinion?
not really sure. if you feel the current types are out of sync with the OAI spec, please open a PR.
Maybe also @mbsimonovic , I see you have contributed in adding componentSchemas
for OAS v3, could you perhaps have a look to this issue and the PR I created?
ah this was years ago, i havent used kogos since