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

Inverted Exclusive and Inclusive when parsing? #31

Open
rbardou opened this issue Aug 9, 2019 · 0 comments
Open

Inverted Exclusive and Inclusive when parsing? #31

rbardou opened this issue Aug 9, 2019 · 0 comments

Comments

@rbardou
Copy link

rbardou commented Aug 9, 2019

Hello,

If I'm not mistaken, in the following lines of code:

let minimum =
if opt_bool_field false json "exclusiveMinimum" then
match opt_int_field json "minimum" with
| None ->
let err =
"minimum field required when exclusiveMinimum is true" in
raise (Failure err)
| Some v -> Some (v, `Inclusive)
else
match opt_int_field json "minimum" with
| None -> None
| Some v -> Some (v, `Exclusive) in
let maximum =
if opt_bool_field false json "exclusiveMaximum" then
match opt_int_field json "maximum" with
| None ->
let err =
"maximum field required when exclusiveMaximum is true" in
raise (Failure err)
| Some v -> Some (v, `Inclusive)
else
match opt_int_field json "maximum" with
| None -> None
| Some v -> Some (v, `Exclusive) in

if exclusiveMinimum is true, this results in Inclusive, and if it is false, it results in Exclusive. Same for exclusiveMaximum. Shouldn't it be the other way around?

Cheers

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

No branches or pull requests

1 participant