swagger4spring-web
swagger4spring-web copied to clipboard
Custom property names for @RequestBody
My @RequestBody class looks like this:
public static class OrderRequest {
@JsonProperty("product-offering-id")
public String productOfferingId;
@JsonProperty("initial-state")
public String initialState;
}
Swagger generates such model:
OrderRequest {
productOfferingId (string, optional),
initialState (string, optional)
}
and model schema is:
{
"productOfferingId":"",
"initialState":""
}
Can Swagger generate correct names?
Seconded. We're experiencing a very similar problem because we configure our ObjectMapper instance with the snake case property naming strategy:
objectMapper.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES);