Skip to main content

Type Alias: JsonSchemaProperty

JsonSchemaProperty = { description?: string; items?: unknown; type: JsonSchemaPrimitiveType | JsonSchemaPrimitiveType[]; } | { allOf?: unknown[]; anyOf?: unknown[]; description?: string; oneOf?: unknown[]; }

Defined in: http-server-mcp-openapi/src/types.ts:20

A single JSON Schema property descriptor as emitted for a tool's inputSchema. Only the subset of JSON Schema the generator produces is modelled here; the value is forwarded verbatim over the MCP wire protocol.

A property with OpenAPI oneOf/anyOf is forwarded as-is (no type) so a client-side validator enforces the same alternatives the REST API does, rather than collapsing to a single guessed primitive. type may be an array of two entries (e.g. ['string', 'null']) to represent an OpenAPI nullable: true property without losing its declared type. A property with no declared type is emitted untyped (only description), so it accepts any value instead of a guessed string.