x-simile-from-request on a response media type.
Use the extension only for public API behavior: values the service promises to preserve, totals it
promises to derive, lifecycle outcomes controlled by public request fields, and fields that cannot
appear for a given public flow. It should not describe private risk checks or implementation details.
A complete relation
- the customer and order number are the values supplied by the caller;
- line items preserve caller-owned fields while response-only fields such as IDs are synthesized;
- the total equals the submitted unit prices multiplied by their quantities;
- omitting
execute_paymentuses its public default offalse; - the resulting lifecycle is
requires_payment, with paid-only and refund data absent.
Bindings
A binding withfrom copies a validated request value into a response target. A plain string is an
absolute JSON Pointer into the request body. Body selectors may contain * to traverse arrays. The
response target must name one concrete property.
default when omission has a
publicly specified meaning.
Request locations
Relations can also read path, query, header, and cookie parameters. Parameter sources name the OpenAPI parameter rather than a JSON Pointer:from: { body: /customer_id }; it is equivalent to from: /customer_id. Simile compiles each
source against the request body or parameter schema and reads only the value returned by request
validation. A relation can combine body and parameter sources, including a multipart body with a
query or header parameter.
Derived values
A binding withvalue computes its target. Supported expressions are:
requestfor an absolute request selector;pathfor a selector relative to the current item insidesum;literalfor a fixed JSON value;addandmultiplyfor finite numeric expressions; andsumfor a value derived from every item selected byeach;concatfor joining string expressions;substringfor selecting a Unicode character range, with negative indexes counted from the end;maskfor replacing all but the lastrevealcharacters; andcoalescefor selecting the first expression that resolves to a value.
Guarded rules
Rules make public request controls select reachable response states. Every condition inwhen.all
must match. A condition may declare a default for an omitted request field.
then.set assigns response values accepted by their schemas. then.omit removes optional data that
cannot exist in the selected flow. Compilation rejects attempts to omit required response fields.
Proof levels
Every emitted response is validated against its standalone response schema. When validated request values and a compiled relation are both present, Simile additionally applies and proves the relation, and reports the response asRequestConstrained. The proof uses the request body and any
compiled path, query, header, or cookie sources referenced by the relation. Without that relation,
the result is reported as SchemaOnly even if same-path structural projection improved it.
That distinction is deliberate: Simile does not claim an operationally reachable result unless it
has executable public proof material for the relationship.
Read Response synthesis for runtime selection and construction, or
Payload soundness for relationships within one payload.