-
-
Notifications
You must be signed in to change notification settings - Fork 761
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
Add flag for validation disabling #182
Comments
@rafaelcaricio @jmcs could you check this? |
I was reading about this issue which cover this topic about Swagger/OpenAPI Spec. I would be nice to support |
@rafaelcaricio Yes this looks very promising! I'll give it a try this week. Thank you! |
@rafaelcaricio Great! |
@rafaelcaricio So it is possible to write a validator for |
@cansik You validate types using formats, no? Do you wanna define new types? |
@rafaelcaricio Yes your right, but as described in my initial issue, we need to support nullable types. This isn't possible with So the only possible option I have would be to send the data as string and validate it then with a formatter. Am I right? |
@cansik you can define many types for a single field. So in your case you can do: {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"value": {
"type": ["integer", "null"],
"format": "int32"
}
}
} No need for new types. This is pure JSON schema stuff. |
@rafaelcaricio Very nice! This works great! Thank you so much! |
@rafaelcaricio great suggestion about using an array of type values. It works great if I manually adjust the swagger.json in the codegen output. Unfortunately, since I was initially hopeful that |
I agree that this is something that should be supported. I am forced to input 0 as a symbol for null in some properties of |
In my swagger definition I have a lot of parameters which contain a valid datatype which then is needed for our automated query builder:
Now the problem we encounter is, that sometimes the validation of these types is not possible because we need for example nullable types as well.
So my question is, if it is possible to add an option which disables the validation or a method to provide an own validator class for some datatypes?
The text was updated successfully, but these errors were encountered: