Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 744
Hennadii Madan Avatar asked Sep 04 '25 17:09

Hennadii Madan


1 Answers

this schema should work

type: integer
not:
  multipleOf: 2
minimum: 0
like image 195
Ethan Avatar answered Sep 07 '25 18:09

Ethan