FieldViolation
A single field of the request that was rejected, and why.
Path of the offending field, in request-body naming. Array entries are indexed and
map entries are keyed, e.g. purchase_url, allowed_publish_urls[2],
custom_fields["asset_id"].string_value.
Machine-readable cause of the violation — the value to branch on:
REQUIRED: A field the request cannot omit was not providedINVALID_TYPE: The value has the wrong JSON type for the fieldINVALID_FORMAT: The value has the right type but is not well-formed for the field, e.g. an unparsable URL or timestamp, or a fixed-length value of the wrong lengthUNSUPPORTED_SCHEME: A URL uses a scheme the field does not accept (onlyhttpsis accepted)FORBIDDEN_USERINFO: A URL carries userinfo (user:password@), which is never acceptedFORBIDDEN_HOST: A URL points at a host the field does not accept, such as an IP literal or localhostTOO_LONG: The value is longer than the field allowsTOO_MANY: The list or map holds more entries than the field allowsINVALID_CHARACTERS: The value contains characters the field does not accept, such as control charactersUNKNOWN_VALUE: The value is not one of the values the field defines, e.g. an unknownshare_stateNOT_ALLOWED_HERE: The field is well-formed but not allowed in this combination, e.g. a distribution field on aprivateRecordEXACTLY_ONE_REQUIRED: Exactly one of a group of mutually exclusive properties must be set, e.g. the typed value of acustom_fieldsentryUNKNOWN_FIELD: The body carries a field the endpoint does not define — commonly a misspelling, or a camelCase spelling of a snake_case fieldEMPTY: The value is present but empty where a value is requiredINVALID_PATTERN: A URL pattern is malformed and cannot be interpreted
The set is closed, but it may be extended with new reasons. Treat a reason you do
not recognise as a generic validation failure rather than failing hard.
Possible values: [REQUIRED, INVALID_TYPE, INVALID_FORMAT, UNSUPPORTED_SCHEME, FORBIDDEN_USERINFO, FORBIDDEN_HOST, TOO_LONG, TOO_MANY, INVALID_CHARACTERS, UNKNOWN_VALUE, NOT_ALLOWED_HERE, EXACTLY_ONE_REQUIRED, UNKNOWN_FIELD, EMPTY, INVALID_PATTERN]
Human-readable explanation of this violation, safe to log and to show to a developer.
It may name the offending field or map key and state the limit that applies, but it never echoes the value that was submitted. English, not localized, and the wording is not stable across releases — never parse or branch on it.
{
"field": "string",
"reason": "REQUIRED",
"description": "string"
}