jhthorsen / mojolicious-plugin-openapi

OpenAPI / Swagger plugin for Mojolicious
53 stars 41 forks source link

Integer and Number type query parameters treated as String types in OASv2 #216

Closed lafokamotion closed 3 years ago

lafokamotion commented 3 years ago

Working with OpenAPI v2, given the following definition of a parameter: image

I then hit the route with the query parameter defined as count=5 and receive the following OpenAPI generated response: image

I can skip adding the query param, in which case, the default value of 300 is properly used for the count param value and no failure occurs.

This issue also occurs with number type parameters. I did manage to convert my spec to OpenAPI v3 and it appears to not be an issue for v3.

This seems to be an issue starting at version 4.00

jhthorsen commented 3 years ago

I don't see how this is possible (see the tests in e129529) unless you have disabled coercion.