public class ValidationErrorResourceAssembler extends Object implements ResourceAssembler<ValidationError,ValidationErrorResource>
| Constructor and Description |
|---|
ValidationErrorResourceAssembler() |
ValidationErrorResourceAssembler(ObjectMapper objectMapper) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
convertProperty(String propertyName)
Converts the given property name (field name or error code) using the application defined
PropertyNamingStrategy for consistent output in
responses. |
ValidationErrorResource |
toResource(ValidationError validationError)
Converts the given object into a resource.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittoResourcespublic ValidationErrorResourceAssembler()
public ValidationErrorResourceAssembler(ObjectMapper objectMapper)
public ValidationErrorResource toResource(ValidationError validationError)
ResourceAssemblertoResource in interface ResourceAssembler<ValidationError,ValidationErrorResource>protected String convertProperty(String propertyName)
PropertyNamingStrategy for consistent output in
responses. The naming strategy is defined in application.yml via the
'spring.jackson.property-naming-strategy' property.
For example, if the
PropertyNamingStrategy.LowerCaseWithUnderscoresStrategy
is defined, the following field names and error codes will be translated as following: