Skip to content

Unexpected validation error on consumes/produces with external references #22

Description

@giuliopulina

Hi all,

while working on OAI/OpenAPI-Specification#21 I discovered a possible issue with consumes/produces validation.
What I'm trying to do is:

  1. using a valid OpenApi 2.0 spec file ('swagger-editor-external-ref-definition-imported.yml', that's the Uber API)
  2. Importing some definitions from above file in another spec file ('swagger-doc-external-ref-definition.yml').

I'm getting an unexpected error during validation:
[SemanticError at paths./test.get: 'produces' must be equal to 'produces: []', SemanticError at paths./test2.get: 'produces' must be equal to 'produces: []']

I'm afraid I need to change the 'imported' file to make this work, but I think it's not correct (and, often, in real life you can't really do that).

Furthermore, I came across this recent discussion about semantic validation in OpenAPI (OAI/oascomply#54) and there's no mention about consumes/produces validation (except this one: "Parameters with type of file must have a consumes of multipart/form-data or application/x-www-form-urlencoded").
Is it possible that the validation that has been introduced is too strict and not conforming to the OpenAPI 2.0 spec?

@oyeli can you maybe help on this?
You can find failing tests and test files in my branch: https://github.com/giuliopulina/swagger-validator-maven-plugin/tree/bugfix/Issue-21_external_ref_with_no_dot_not_working

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions