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

validation of default value conformity #136

Closed
bonnyr opened this issue Oct 31, 2019 · 1 comment · Fixed by #610
Closed

validation of default value conformity #136

bonnyr opened this issue Oct 31, 2019 · 1 comment · Fixed by #610

Comments

@bonnyr
Copy link

bonnyr commented Oct 31, 2019

The OpenAPI Spec states that the default property, when applied to a schema must use the same values as the underlying property type, thus, a string property cannot have an integer value specified etc.

https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#schema-object
default - The default value represents what would be assumed by the consumer of the input as the value of the schema if one is not provided. Unlike JSON Schema, the value MUST conform to the defined type for the Schema Object defined at the same level. For example, if type is string, then default can be "foo" but cannot be 1.

This is currently not covered by the project as best I can tell.

Is this on anyone's radar to fix? I'm currently working on a private version that tackles that for our use case, but will be happy to upstream this if needed

@fenollp
Copy link
Collaborator

fenollp commented Nov 2, 2019

No idea if it's on anyone's radar. This project is about implementing the whole OA3 spec so I'd gladly review your PRs :)

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 a pull request may close this issue.

2 participants