open-api icon indicating copy to clipboard operation
open-api copied to clipboard

openapi-request-validator: Fix componentSchemas type (fixes #820)

Open aldex32 opened this issue 2 years ago • 4 comments

aldex32 avatar Jul 08 '22 16:07 aldex32

thanks @aldex32 . i believe this is technically a breaking change correct?

jsdevel avatar Jul 08 '22 19:07 jsdevel

Hey @jsdevel , yes it is a breaking change. I can avoid it buy making it backward compatible like this:

  componentSchemas?: IJsonSchema[] | { [key: string]: OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject; };

But I am not sure if the type IJsonSchema[] is/was correct. Also all the tests I see in this project are not assigning any array to this field. Unfortunately the tests are not type checking the arguments passed to the constructor of OpenAPIRequestValidator and this probably was the reason of not catching the wrong type.

aldex32 avatar Jul 08 '22 20:07 aldex32

@aldex32 breaking change doesn't scare me. is this in line with th OpenAPI schema?

jsdevel avatar Aug 01 '22 18:08 jsdevel

@aldex32 ?

jsdevel avatar Sep 15 '22 21:09 jsdevel