skeuomorph icon indicating copy to clipboard operation
skeuomorph copied to clipboard

Unexpected behavior? - OpenAPIParser

Open angoglez opened this issue 5 years ago • 0 comments

Description

I think I found that and unexpected behavior working with ParseOpenApi and using the parseYamlOpenApi object.

Can be reproduced like that:

  1. Create a file which content is a raw string containing a valid JSON OpenAPI schema
  2. Wrap it inside a YamlSource
  3. Use it inside parseYamlOpenApi.parse function to obtain the proper parser.
  4. Result: everything goes OK

🔗 This gist can help.

It doesn't happen the other way round. That is, if you wrap a correct YAML inside a JsonSource and try to use the parseJsonOpenApi method.

I guess, if two different parsers are provided, each one for different formats (modeled in two different case classes), should be this the expected behavior? or it should trigger the error from the first moment saying it's not a proper YAML source?

angoglez avatar Jun 29 '20 16:06 angoglez