This document catalogues what validation rules are in place for element creation payloads.
We assume general familiarity with Libraries, and the element creation process.
Definitions
Term
Definition
property path (column heading)
Path to property in JSON document.
condition (column heading)
The condition that must be fulfilled for a validation to execute.
type (column heading)
The JSON type expected for some property value, or the Java type that the JSON value will be coerced into if it is more restrictive then the JSON type and is a primitive type or the boxed equivalent. Additionally, some properties are polymorphous, and may have different validation rules associated with different types.
empty (string)
A string containing no characters, e.g., "".
blank (string)
A string containing only whitespace, e.g., " ".
always (execution condition)
Indicates that a validation will always be performed, regardless of property value.
when present (execution condition)
Indicates that a validation will only be performed if the property value is non-null.
well-known (element or representation type)
An element or representation type for which we have implemented bespoke validation logic.
well-known (property in paragraph or character style)
A style for which we have implemented bespoke validation logic.
supported (element or representation type)
An element or representation type that can be used in requests.
user-uploaded asset
Binary data uploaded before a library element is created referring to the uploaded data.
concrete MIME type
A MIME type that is both valid, and does not contain wildcards, e.g., "image/*" is a valid MIME type, but is not concrete, but "image/png" is valid and concrete.
JSON Property Path Legend
Symbol
Description
$
contextual document root, will refer to the last object level named in a heading
.aProperty
property access
[1]
array index
.*
all properties in object
[*]
all indexes in array
.{a, b, c, d}
a specific set of possible properties
[*](property=value)
a selector; all objects in the array where property=value
Validation and Type Coercion
There are effectively two layers of processes that sanitize service input. The first is the process that maps input to
models with strongly-typed properties. The second is explicit validation logic that interrogates
payload content after it has been mapped. A payload may be rejected within either layer, but, these errors will appear
differently to the service consumer. For example, if a property value should be coerced into an integer in the
mapping layer, but the JSON type of the value supplied was string, and, that string contained non-numeric
characters, then the service consumer may get a 500 in response as the type coercion would fail. However,
if we had implemented validation that enforces a range for this property, the consumer supplied a valid number that could be
coerced into an integer, and this number fell outside of the allowed range, we would return a 400. Since, in effect,
both processes sanitize input, both are accounted for in this document.
A couple examples\:
Property Path
Condition
Type
Validation
$.adbeDesiredLetterSpacing
when present
number
must be between -100 and 500, inclusive
In this example, if the supplied value was not coercible into a number, the payload would be rejected.
If the supplied value was coercible, then the validation rule "must be between -100 and 500, inclusive"
would apply.
Property Path
Condition
Type
Validation
$.vectorColor
when present
boolean
none (coercion only)
In this example, if the supplied value was not coercible into a boolean, the payload would be rejected.
If the supplied value was coercible, no other validation would occur.
MIME Types Associated With User-Uploaded Assets
Copied to your clipboard
1 private static final String[] assetMimeTypes = {
all validations from application/vnd.adobe.element.characterstyle+json, except where marked 🚩
$.adbeParaAlignment
when present
string
must be one of {"Alignment.LEFT_ALIGN", "Alignment.CENTER_ALIGN", "Alignment.RIGHT_ALIGN", "Alignment.LEFT_JUSTIFIED", "Alignment.CENTER_JUSTIFIED", "Alignment.RIGHT_JUSTIFIED", "Alignment.FULLY_JUSTIFIED"}
$.adbeLeftIndent
when present
object
must be a valid Unit
$.adbeFirstLineIndent
when present
object
must be a valid Unit
$.adbeRightIndent
when present
object
must be a valid Unit
$.adbeSpaceBefore
when present
object
must be a valid Unit
$.adbeSpaceAfter
when present
object
must be a valid Unit
$.adbeMinimumWordSpacing
when present
number
must be between 0 and 1000, inclusive
$.adbeDesiredWordSpacing
when present
number
must be between 0 and 1000, inclusive
$.adbeMaximumWordSpacing
when present
number
must be between 0 and 1000, inclusive
$.adbeMinimumLetterSpacing
when present
number
must be between -100 and 500, inclusive
$.adbeDesiredLetterSpacing
when present
number
must be between -100 and 500, inclusive
$.adbeMaximumLetterSpacing
when present
number
must be between -100 and 500, inclusive
$.adbeMinimumGlyphScaling
when present
number
must be between 50 and 200, inclusive
$.adbeDesiredGlyphScaling
when present
number
must be between 50 and 200, inclusive
$.adbeMaximumGlyphScaling
when present
number
must be between 50 and 200, inclusive
$.adbeParaAutoLeading
when present
number
must be between 0 and 500, inclusive
$.adbeSingleWordJustification
when present
string
must be one of {"Justification.FULLY_JUSTIFIED", "Justification.LEFT_ALIGN", "Justification.CENTER_ALIGN", "Justification.RIGHT_ALIGN"}
audio/ (see Supported Audio Types) postLibraryElementPayload.representations[](type=application/vnd.adobe.audio+json).audio#data