oaspec/codegen/schema_dispatch
Values
pub fn decoder_expr(ref: schema.SchemaRef) -> String
Map a schema ref to its decoder expression (for inline primitives) or decoder function name (for references).
pub fn json_encoder_expr(
ref: schema.SchemaRef,
value: String,
) -> String
Map a schema ref to its JSON encoder expression.
pub fn json_encoder_fn(ref: schema.SchemaRef) -> String
Map a schema ref to its JSON encoder function reference (for higher-order use).
pub fn resolve_param_type(
schema_ref: option.Option(schema.SchemaRef),
spec: spec.OpenApiSpec(spec.Resolved),
) -> String
Resolve a schema ref and return the base type (for parameter type resolution).
pub fn schema_base_type(schema: schema.SchemaObject) -> String
Map a schema object to its Gleam type string (without nullable wrapping).
pub fn schema_ref_qualified_type(ref: schema.SchemaRef) -> String
Map a schema ref to a qualified Gleam type (with types. prefix for refs).
pub fn schema_ref_to_string_expr(
ref: schema.SchemaRef,
value: String,
spec: spec.OpenApiSpec(spec.Resolved),
) -> String
Map a schema ref to a to_string expression, resolving refs if needed.
pub fn schema_ref_type(ref: schema.SchemaRef) -> String
Map a schema ref to a Gleam type string.
pub fn schema_type(schema: schema.SchemaObject) -> String
Map a schema object to its Gleam type string (with nullable wrapping).
pub fn to_string_expr(
schema: schema.SchemaObject,
value: String,
) -> String
Map a primitive schema to its to_string expression. Returns the expression that converts a value to String for URL encoding.
pub fn to_string_fn(
ref: schema.SchemaRef,
spec: spec.OpenApiSpec(spec.Resolved),
) -> String
Map a schema ref to its to_string function reference (for list.map etc).