Skip to content

routier-collection


routier-collection / core/src / rehydrateSchemaFromJsonSchema

Function: rehydrateSchemaFromJsonSchema()

rehydrateSchemaFromJsonSchema(jsonSchema, collectionName?): SchemaDefinition<any>

Defined in: core/src/schema/utils/standardJsonSchema.ts:576

Rehydrates a JSON Schema back into a Routier SchemaDefinition. This parses the JSON Schema structure and reconstructs the schema using Routier's builder API.

Parameters

jsonSchema

Record<string, unknown>

The JSON Schema object to rehydrate

collectionName?

string

The collection name for the schema (if not in x-routier metadata)

Returns

SchemaDefinition<any>

A SchemaDefinition that can be compiled

Released under the MIT License.