I have the following problem:
I have an endpoint with request body like ContactRequest:
public class ContactRequest{
private String message;
private Object result;
}
BUT this endpoint is invoked by some other service with JSON payload with upper case:
{
"Message": "Some text",
"Result": "Resultsdsddwd"
}
I try to use pattern in openapi.yml but I think it's not the correct fix for my problem because in code I use ContactRequest object with lower case fields...
ContactRequest:
pattern: ^[A-Za-z\s_-]+$
type: object
required:
- id
- status
- message
My endpoint:
public CommandResponse save(
ContactRequest contactRequest){
...
}
Did someone have similar problem? I can't change the request body
PS. Maybe there is something like @JsonAlias in OpenApi.yml generator file?
UPDATE Maybe should I use global settings to set case insensitive?
My build.gradle file:
implementation group: 'org.openapitools', name: 'jackson-databind-nullable', version: '0.2.1'
implementation group: 'org.modelmapper', name: 'modelmapper', version: '2.3.6'