We have a POST API in Spring Boot and there is one Request Body Model class got generated through Swagger CodeGen with OpenApi yaml file. One field is annotated with,
@Schema(accessMode = Schema.AccessMode.READ_ONLY)
Code snippet:
public class Sample {
@JsonProperty("name")
private String name = null;
@JsonProperty("plainData")
@Valid
private final Map<String, Object> plainData = new HashMap<String, Object>();
@JsonProperty("data")
@Valid
private final Map<String, Object> data = new HashMap<String, Object>();
....
@Schema(accessMode = Schema.AccessMode.READ_ONLY, description = "Encrypted version of the data")
public Map<String, Object> getData() {
return data;
}
....
}
So the field 'data' will not be supplied in POST Request Body by the Client?
And in case by mistake the Client sends the filed 'data' in the Request Body json what will happen?