Normalizes and validates field definitions written in the DSL and map forms.
This module is the entry point for the related functionality. Individual operations are
split among Normalizer, Validator, and Compiler.
Summary
Functions
Compiles a map-based schema definition into validated fields.
Compiles field definitions into structs used by the parser.
Converts a map-based schema into a list of field definitions.
Returns the mapping between DSL options and JSON Schema keywords.
Splits a type definition into its type and options and normalizes it to the internal representation.
Normalizes all field definitions and validates unique names and input keys.
Types
@type normalized_definition() :: {type :: ExParamsSchema.field_type(), options :: ExParamsSchema.field_options()}
Functions
@spec compile!(%{required(atom()) => ExParamsSchema.definition()}) :: [ ExParamsSchema.Definition.Field.t() ]
Compiles a map-based schema definition into validated fields.
@spec compile_fields!([ExParamsSchema.field()]) :: [ ExParamsSchema.Definition.Field.t() ]
Compiles field definitions into structs used by the parser.
@spec fields_from_map!(%{required(atom()) => ExParamsSchema.definition()}) :: [ ExParamsSchema.field() ]
Converts a map-based schema into a list of field definitions.
Returns the mapping between DSL options and JSON Schema keywords.
@spec normalize!(ExParamsSchema.definition()) :: normalized_definition()
Splits a type definition into its type and options and normalizes it to the internal representation.
@spec normalize_fields!([ExParamsSchema.field()]) :: [ExParamsSchema.field()]
Normalizes all field definitions and validates unique names and input keys.