swagger-api / swagger-core

Examples and server integrations for generating the Swagger API Specification, which enables easy access to your REST API
http://swagger.io
Apache License 2.0
7.36k stars 2.17k forks source link

BUG Unable to deserialize OpenAPI Parameter #4689

Open joyceli214 opened 3 weeks ago

joyceli214 commented 3 weeks ago

I was trying to convert json string to OpenAPI object and met below error:

Cannot deserialize value of type io.swagger.v3.oas.models.parameters.Parameter$StyleEnum from String "form": not one of the values accepted for Enum class: [MATRIX, SIMPLE, SPACEDELIMITED, FORM, DEEPOBJECT, LABEL, PIPEDELIMITED]

Then I tried to run below code (captured from ParameterDeSerializationTest.java) and also failed (threw same error). final String json = "{\"in\":\"query\",\"style\":\"form\",\"required\":false,\"schema\":{\"type\":\"string\"}}"; final Parameter p = m.readValue(json, Parameter.class);

Is this a bug?