jhthorsen / openapi-client

A client for talking to an Open API powered server
11 stars 17 forks source link

numification instead of boolean interpretation of the "exclusiveMaximum" type restriction #42

Open XSven opened 11 months ago

XSven commented 11 months ago

We have an OpenAPI specification that has a response component object with status attribute

        status:
          type: integer
          format: int32
          description: >
            The HTTP status code generated by the origin server for this occurrence
            of the problem.
          minimum: 100
          maximum: 600
          exclusiveMaximum: true
          example: 503

We have used the exclusiveMaximum type restriction. Rendering a response with a status code 400 causes a strange validation error

{errors => [{message => "400 >= maximum(1)",path => "/body/status"}],status => 500}

The 1 in maximum(1) is (with high probability) caused by the numification of JSON::PP::true. This looks like a bug.