I want to allow only isActive
and name
parameter in the @RequestBody and want to ignore price
attribute.
Is there a way to do so in Spring Boot?
{
"isActive": true,
"name": "prandajsbdduts",
"price": 10
}
Sure, you just don't need to put price
field in your DTO. When you have something like this:
public class SomeDTO {
private Boolean isActive;
private String name;
/getters & setters
}
price
will be ignored.
Collected from the Internet
Please contact javaer1[email protected] to delete if infringement.
Comments