openapi-spec-validator icon indicating copy to clipboard operation
openapi-spec-validator copied to clipboard

openapi-spec-validator fails for integer response codes

Open vmalloc opened this issue 6 years ago • 2 comments

Current SwaggerHub implementation exports YAMLs with responses looking like:

responses:
    200:
        description: success

This leads openapi-spec-validator to fail trying to apply a regex to the 200 status code. Assuming what SwaggerHub exports is correct, openapi-spec-validator should not fail on such an input...

vmalloc avatar Jul 21 '19 18:07 vmalloc

I ran into this, trying to use openapi-core. It first runs the spec through openapi-spec-validator, which fails on some cryptic jsonschema TypeError (doing re.search() on an int instead of str).

Converting the YAML to JSON first and validating the JSON works, however validating the YAML should also be supported.

remram44 avatar Jan 12 '21 03:01 remram44