JSON Schema's readOnly / writeOnly keywords carry directional
semantics: a readOnly property must not appear in client → server
payloads, and a writeOnly property must not appear in server →
client payloads. Mapping a schema to a TypeScript type therefore
requires knowing which direction the value travels.
"both" — return every property regardless of readOnly /
writeOnly. Default, preserves the prior behaviour for callers
that do not care about the distinction.
"input" — omit properties marked readOnly: true. Use for the
shape consumers may supply (e.g. onChange arguments, POST
bodies).
"output" — omit properties marked writeOnly: true. Use for
the shape the server returns (e.g. rendered value props, GET
responses).
Direction of inference for
FromJSONSchema.JSON Schema's
readOnly/writeOnlykeywords carry directional semantics: areadOnlyproperty must not appear in client → server payloads, and awriteOnlyproperty must not appear in server → client payloads. Mapping a schema to a TypeScript type therefore requires knowing which direction the value travels."both"— return every property regardless ofreadOnly/writeOnly. Default, preserves the prior behaviour for callers that do not care about the distinction."input"— omit properties markedreadOnly: true. Use for the shape consumers may supply (e.g.onChangearguments, POST bodies)."output"— omit properties markedwriteOnly: true. Use for the shape the server returns (e.g. renderedvalueprops, GET responses).