Hennadii Madan
Hennadii Madan

Reputation: 1623

JSON schema for odd numbers

How to have a JSON schema to validate for odd positive integers? At first glance it seems impossible, but perhaps there's some trick?

Upvotes: 4

Views: 390

Answers (1)

Ethan
Ethan

Reputation: 725

this schema should work

type: integer
not:
  multipleOf: 2
minimum: 0

Upvotes: 6

Related Questions