Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check that param type is present via either schema or content #251

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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