JsonFabrica

Schemas appendix

Field tables for every named schema referenced across the endpoint group pages (linked from each endpoint's request/response section by name).

ErrorEnvelope

FieldTypeRequiredDescription
errorobjectYes—

AuthContext

FieldTypeRequiredDescription
tenantIdstringNo—
role`admin` | `user`No—

TemplateDto

FieldTypeRequiredDescription
templateIdstringNo—
tenantIdstringNo—
namestringNo—
descriptionstringNo—
bodystringNo—
astCachearray of anyNo—
tagsarray of stringNo—
validatedbooleanNo—
warningsarray of stringNo—
status`active` | `archived`No—
createdAtstringNo—
updatedAtstringNo—

SequenceDto

FieldTypeRequiredDescription
tenantIdstringNo—
namestringNo—
type`number` | `string` | `uuid`No—
currentValuenumberNo—
startnumberNo—
stepnumberNo—
createdAtstringNo—
updatedAtstringNo—

BatchDocumentSpec

FieldTypeRequiredDescription
templateIdstringYes—
aliasstringYes—
countintegerYes—
relationsobjectNo—
paramsobjectNoTemplate params (read with getParam) for every document of this alias. Shallow-merged over the batch-level `params`; keys here win. Must be a JSON object, otherwise 400 VALIDATION_ERROR.
sequenceNamespacestringNoOverrides the batch-level sequenceNamespace for this alias only.
variableNamespacestringNoOverrides the batch-level variableNamespace for this alias only.

BatchSpec

FieldTypeRequiredDescription
seednumberNo—
paramsobjectNoDefault template params for every document in the batch. Each document's own `params` are shallow-merged over these (document keys win). Must be a JSON object, otherwise 400 VALIDATION_ERROR.
sequenceNamespacestringNoDefault sequence namespace for every document (a document may override it).
variableNamespacestringNoDefault variable namespace for every document (a document may override it).
documentsarray of BatchDocumentSpecYes—

BatchResults

Generated documents keyed by document alias (the `alias` values from the request's `documents[]`). Each value is an array of `count` generated documents, in generation order — the documents themselves, exactly as the template renders them (plus any injected relation fields), with no per-document wrapper. A document is usually an object, but can be any JSON value the template produces (array, string, number, boolean or null), e.g. `[[7,3,3,0],[8,2,2,0]]` or `["plain 7","plain 8"]`. Only present when `status` is `completed`.

No documented fields.

BatchError

Why the batch failed. Only present when `status` is `failed`.

FieldTypeRequiredDescription
codestringYes—
messagestringYes—

FunctionWeightDto

FieldTypeRequiredDescription
functionNamestringNo—
weightnumberNo—
updatedAtstringNo—
updatedBystringNo—

TenantUsageDto

FieldTypeRequiredDescription
tenantIdstringNo—
usageTotalnumberNo—
asOfstringNo—

GenerateRequestDto

FieldTypeRequiredDescription
seednumberNo—
paramsobjectNo—
contextobjectNo—
sequenceNamespacestringNo—
variableNamespacestringNo—

GenerateResponseDto

FieldTypeRequiredDescription
dataanyNo—
metaobjectNo—

AdhocGenerateRequestDto

Feature 1a (ad-hoc/debug generation) — same fields as `GenerateRequestDto` plus the required raw template `body`. Nothing is persisted; useful for quickly iterating on a template before committing it via `POST /v1/templates`.

FieldTypeRequiredDescription
bodystringYes—
seednumberNo—
paramsobjectNo—
contextobjectNo—
sequenceNamespacestringNoRecommended for ad-hoc calls to avoid colliding with real tenant sequences created by persisted templates.
variableNamespacestringNo—

AdhocGenerateResponseDto

Same shape as `GenerateResponseDto` but `meta` has no `templateId` — nothing was persisted.

FieldTypeRequiredDescription
dataanyNo—
metaobjectNo—

CreateTemplateRequestDto

FieldTypeRequiredDescription
namestringYes—
descriptionstringNo—
bodystringYes—
tagsarray of stringNo—
generateobjectNoFeature 1b (one-shot create+generate, issue #5). When present, the template is created and, immediately after, a document is generated from it using these options (same fields as `GenerateRequestDto` minus `sequenceNamespace`/ `variableNamespace`, which follow the template's own tenant defaults). Omit this field for the original create-only behavior.

GenerationErrorDto

Inline generation error embedded in a 201 create+generate response when the template was persisted successfully but the immediate generation attempt failed at runtime (e.g. a required param with no default). Distinct from the top-level `ErrorEnvelope` used for actual HTTP error responses — this always accompanies a 201 with a populated `template`.

FieldTypeRequiredDescription
codestringNo—
messagestringNo—

CreateTemplateResponseDto

Three possible response shapes depending on the request (feature 1b): 1. `generate` absent — plain `TemplateDto` (unchanged, backward compatible). 2. `generate` present and generation succeeds — `{ template, generation }`. 3. `generate` present but generation fails at runtime — `{ template, generationError }` (the template was still persisted; only 201 create is not undone by a generate-time failure). `generation` and `generationError` are mutually exclusive.

This schema is a union of multiple shapes — see the description above for the exact variants.