Skip to content

x-to-zod / JsonSchemaAdapter

Class: JsonSchemaAdapter

Defined in: src/SchemaInput/JsonSchemaAdapter.ts:8

Protocol for plugging alternative input formats into the x-to-zod pipeline.

Implement this interface to teach x-to-zod about a new schema format without modifying any core file.

Implements

Constructors

Constructor

ts
new JsonSchemaAdapter(): JsonSchemaAdapter;

Returns

JsonSchemaAdapter

Methods

getMetadata()

ts
getMetadata(input): SchemaMetadata;

Defined in: src/SchemaInput/JsonSchemaAdapter.ts:27

Parameters

input

unknown

Returns

SchemaMetadata

Implementation of

SchemaInputAdapter.getMetadata


getRef()

ts
getRef(input): string | undefined;

Defined in: src/SchemaInput/JsonSchemaAdapter.ts:17

Parameters

input

unknown

Returns

string | undefined

Implementation of

SchemaInputAdapter.getRef


isValid()

ts
isValid(input): boolean;

Defined in: src/SchemaInput/JsonSchemaAdapter.ts:9

Parameters

input

unknown

Returns

boolean

Implementation of

SchemaInputAdapter.isValid


selectParser()

ts
selectParser(input, _refs): ParserConstructor | undefined;

Defined in: src/SchemaInput/JsonSchemaAdapter.ts:13

Parameters

input

unknown

_refs

Context

Returns

ParserConstructor | undefined

Implementation of

SchemaInputAdapter.selectParser

Released under the ISC License.