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

VariableDto

FieldTypeRequiredDescription
tenantIdstringNo
namestringNo
type`string` | `number` | `boolean` | `array` | `object`No
valueanyNo
scope`global`No
updatedAtstringNo

BatchDocumentSpec

FieldTypeRequiredDescription
templateIdstringYes
aliasstringYes
countintegerYes
relationsobjectNo
paramsobjectNo

BatchSpec

FieldTypeRequiredDescription
seednumberNo
sequenceNamespacestringNo
variableNamespacestringNo
documentsarray of BatchDocumentSpecYes

BatchDto

FieldTypeRequiredDescription
batchIdstringNo
tenantIdstringNo
seednumberNo
status`queued` | `running` | `completed` | `failed`No
specBatchSpecNo
errorobjectNo
createdAtstringNo

BatchDocumentDto

FieldTypeRequiredDescription
batchIdstringNo
aliasstringNo
seqNointegerNo
templateIdstringNo
status`pending` | `completed` | `failed`No
resultanyNo
documentSeednumberNo

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.