We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Depending on the order of alternative types including :nil, the Swagger JSON can become invalid.
With :nil at the end, it is fine: [:days-paid-leave-sick-child {:optional true} [:or [:int {:min 0 :max 30}] :nil]] becomes
[:days-paid-leave-sick-child {:optional true} [:or [:int {:min 0 :max 30}] :nil]]
days-paid-leave-sick-child: type: integer format: int64 minimum: 0 maximum: 30 x-anyOf: - type: integer format: int64 minimum: 0 maximum: 30 - type: 'null'
which is valid, but with :nil as first item, it is invalid: [:days-until-sick-leave-notice {:optional true} [:or :nil [:int {:min 1 :max 4}]]] becomes
[:days-until-sick-leave-notice {:optional true} [:or :nil [:int {:min 1 :max 4}]]]
days-until-sick-leave-notice: type: 'null' x-anyOf: - type: 'null' - type: integer format: int64 minimum: 1 maximum: 4
which is invalid:
type should be equal to one of the allowed values allowedValues: array, boolean, integer, number, object, string
The text was updated successfully, but these errors were encountered:
Ok, this is a bug. :or should select first non-null as the base-type with JSON Schema. PR welcome on this.
:or
Sorry, something went wrong.
0e9acf8
Merge pull request #1023 from frenchy64/issue-1006-json-non-nil
4824c89
Close #1006: choose non-null base for swagger
Successfully merging a pull request may close this issue.
Depending on the order of alternative types including :nil, the Swagger JSON can become invalid.
With :nil at the end, it is fine:
[:days-paid-leave-sick-child {:optional true} [:or [:int {:min 0 :max 30}] :nil]]
becomes
which is valid, but with :nil as first item, it is invalid:
[:days-until-sick-leave-notice {:optional true} [:or :nil [:int {:min 1 :max 4}]]]
becomes
which is invalid:
The text was updated successfully, but these errors were encountered: