x-simile-constraints to the object schema that owns the related fields. Its value is an array,
and every array item contains exactly one clause:
items object apply independently to each validated or generated item.
Constraints are inherited when a schema is reached through $ref; do not copy them onto every
operation that uses the schema.
JSON Pointer
Everypath is an RFC 6901 JSON Pointer relative to the object containing the extension.
/status selects the status property, and /status_transitions/paid_at selects a nested property.
Escape ~ as ~0 and / inside a property name as ~1.
Selector
A selector is a JSON Pointer that may use a complete* segment to visit every item in an array.
For example, /lines/data/*/amount selects every line amount.
Field predicate
A field predicate has apath and one assertion:
equals— exact JSON scalar or structural equality;contains— an array contains the given value;state—present,absent,null,non-null, ornull-or-absent.
Guard
A guard decides whether a relationship applies. It appears as thewhen value of an aggregate or
as the antecedent of an implication.
Authoring rules
- Publish only relationships that are part of the service’s public contract.
- Keep private risk checks, database decisions, vendor rules, and production thresholds out of distributed OpenAPI.
- Prefer ordinary OpenAPI whenever it can express the rule without an extension.
- Put a relationship on the narrowest object schema that owns all participating fields.
- Treat compilation errors as contract errors; Simile never ignores a clause it cannot prove and construct.
- Remember that constraints prove published behavior, not undisclosed production invariants.