Summary
JSONSchemaVisitor does not emit additionalProperties: false on generated object schemas. Consumers that need strict/closed schemas, notably LLM structured-output APIs (OpenAI, Anthropic), which require additionalProperties: false on every object , must post-process the visitor output to add it.
Proposal
Add an opt-in parameter, consistent with the existing flags (includeTypeTag, defaultsAreOptional, inlineTypes, refRoot), e.g. parameters.additionalPropertiesFalse (or closeObjectSchemas), defaulting to false to preserve historical behavior. When true, every emitted object schema (concept/asset/transaction/event + inline nested objects) includes additionalProperties: false.
Acceptance
- New flag documented in the JSONSchemaVisitor class JSDoc alongside the other options.
- Defaults to false; existing output unchanged.
- Applies recursively to nested inline object schemas.
Summary
JSONSchemaVisitor does not emit additionalProperties: false on generated object schemas. Consumers that need strict/closed schemas, notably LLM structured-output APIs (OpenAI, Anthropic), which require additionalProperties: false on every object , must post-process the visitor output to add it.
Proposal
Add an opt-in parameter, consistent with the existing flags (includeTypeTag, defaultsAreOptional, inlineTypes, refRoot), e.g. parameters.additionalPropertiesFalse (or closeObjectSchemas), defaulting to false to preserve historical behavior. When true, every emitted object schema (concept/asset/transaction/event + inline nested objects) includes additionalProperties: false.
Acceptance