Thanks to visit codestin.com
Credit goes to github.com

Skip to content

inconsistency with exclusiveMinimum & exclusiveMaximum #58

@Ark4ne

Description

@Ark4ne

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
  ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions