@CompileStatic class ValidationReportConstraintViolation extends Object
Part of the response metadata validation report containing details about individual violation of some validation constraint.
An example of corresponding metadata JSON with only interesting parts included:{ "metaData": { "general": { ... }, "http": { ... }, "violation": { "code": "400", "message": "Request myRequest is not valid.", "type": "validation", "validationReport": { root: { type: "myRequest" } constraintViolations: [ { type: "customObjectLevelValidationType", scope: "object", path: "", message: "The combination of properties is not quite right." }, { type: "notNull", scope: "property", path: "myProperty", message: "must not be null" }, { type: "notNull", scope: "property", path: "myOtherProperty", message: "must not be null" }, ... ] } } }, "payload": {} }
Type | Name and description |
---|---|
String |
message Localized message for concrete validation constraint violation. |
String |
path The path of property or object that caused concrete validation constraint violation. |
String |
scope The scope of violated validation constraint describing whether constraint is related to the property or object. |
String |
type The type of violated validation constraint. |
Constructor and description |
---|
ValidationReportConstraintViolation() |
Localized message for concrete validation constraint violation.
The path of property or object that caused concrete validation constraint violation.
It does not include root object type.The scope of violated validation constraint describing whether constraint is related to the property or object.
Should contain onlyproperty
or object
values.
Corresponds to the location where related constraint annotation is applied, for example, FIELD
or GETTER
for property
scope or TYPE
(class) for object
scope.
The type of violated validation constraint.
Corresponds to the uncapitalized simple class name of the constraint annotation, for example,notNull
, notBlank
, etc.
Groovy Documentation