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

inconsistency with exclusiveMinimum & exclusiveMaximum #58

Open
Ark4ne opened this issue Sep 14, 2022 · 0 comments
Open

inconsistency with exclusiveMinimum & exclusiveMaximum #58

Ark4ne opened this issue Sep 14, 2022 · 0 comments

Comments

@Ark4ne
Copy link

Ark4ne commented Sep 14, 2022

Hi,

I noticed an inconsistency on exclusiveMinimum & exclusiveMaximum.

With :

Schema::integer()
    ->exclusiveMinimum(50)
    ->exclusiveMaximum(100)

We obtain :

[
    "type" => "integer"
    "exclusiveMaximum" => 100
    "exclusiveMinimum" => 50
]

Or exclusiveMaximum and exclusiveMinimum must be booleans.

We solution will be to generate:

[
    "type" => "integer"
    "max" => 100
    "minimum" => 50
    "exclusiveMaximum" => true
    "exclusiveMinimum" => true
]

Or to modify the type of the params of the exclusiveMaximum and exclusiveMinimum methods to boolean. (int/float => bool)

Note, the validation currently outputs an error with these cases:

 [
    "property" => "paths./.get.parameters[0].schema.exclusiveMaximum"
    "pointer" => "/paths/~1/get/parameters/0/schema/exclusiveMaximum"
    "message" => "Integer value found, but a boolean is required"
    "constrained" => "type"
    "context" => 1
  ]
 [
    "property" => "paths./.get.parameters[0].schema.exclusiveMinimum"
    "pointer" => "/paths/~1/get/parameters/0/schema/exclusiveMinimum"
    "message" => "Integer value found, but a boolean is required"
    "constrained" => "type"
    "context" => 1
  ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant