Skip to content

Conversation

pilhuhn
Copy link

@pilhuhn pilhuhn commented Feb 21, 2020

According to https://swagger.io/docs/specification/describing-parameters/ a param needs to have a data type that is defined by either schema or content:

Describing Parameters
In OpenAPI 3.0, parameters are defined in the parameters section of an operation or path. To describe a parameter, you specify its name, location (in), data type (defined by either schema or content)

This PR checks that one of schema or content are present. If not an error is reported.

E.g.:

http://0.0.0.0:8081/api/custom-policies/v1.0/openapi.json[72:9]: Exactly one of schema|content must be present
http://0.0.0.0:8081/api/custom-policies/v1.0/openapi.json[76:9]: Exactly one of schema|content must be present
http://0.0.0.0:8081/api/custom-policies/v1.0/openapi.json[80:9]: Exactly one of schema|content must be present

@pilhuhn
Copy link
Author

pilhuhn commented Feb 21, 2020

Test failure is at least on Travis from bad package resolution:

[ERROR] /home/travis/build/RepreZen/KaiZen-OpenApi-Parser/kaizen-openapi-parser/src/main/java/com/reprezen/kaizen/oasparser/model3/Operation.java:[6,24] package javax.annotation does not exist

Same for #249

@ghillairet
Copy link
Member

@pilhuhn That looks good for me, @tedepstein What do you think?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants