oaspec/codegen/types

Types

Result of merging allOf sub-schemas. Re-export from allof_merge for backward compatibility.

pub type MergedAllOf =
  allof_merge.MergedAllOf

Values

pub fn filter_read_only_properties(
  schema_obj: schema.SchemaObject,
  ctx: context.Context,
) -> schema.SchemaObject

Filter readOnly properties from an ObjectSchema for request body context. Returns a new schema with readOnly properties removed.

pub fn filter_write_only_properties(
  schema_obj: schema.SchemaObject,
  ctx: context.Context,
) -> schema.SchemaObject

Filter writeOnly properties from an ObjectSchema for response body context. Returns a new schema with writeOnly properties removed.

pub fn generate(
  ctx: context.Context,
) -> List(context.GeneratedFile)

Generate type definitions from OpenAPI schemas.

pub fn merge_allof_schemas(
  schemas: List(schema.SchemaRef),
  ctx: context.Context,
) -> allof_merge.MergedAllOf

Re-export merge_allof_schemas.

pub fn schema_has_additional_properties(
  schema_ref: schema.SchemaRef,
  ctx: context.Context,
) -> Bool

Check if a schema has typed or untyped additionalProperties that would need Dict.

pub fn schema_has_optional_fields(
  schema_ref: schema.SchemaRef,
  ctx: context.Context,
) -> Bool

Check if a schema has any optional or nullable fields that would need Option.

pub fn schema_has_untyped_additional_properties(
  schema_ref: schema.SchemaRef,
  ctx: context.Context,
) -> Bool

Check if a schema has untyped additionalProperties (needs Dynamic import).

pub fn schema_ref_is_read_only(
  ref: schema.SchemaRef,
  ctx: context.Context,
) -> Bool

Check if a SchemaRef has readOnly metadata, resolving $ref if needed.

pub fn schema_ref_is_write_only(
  ref: schema.SchemaRef,
  ctx: context.Context,
) -> Bool

Check if a SchemaRef has writeOnly metadata, resolving $ref if needed.

pub fn schema_ref_to_type(
  ref: schema.SchemaRef,
  ctx: context.Context,
) -> String

Convert a SchemaRef to a Gleam type string.

pub fn schema_to_gleam_type(
  schema: schema.SchemaObject,
  ctx: context.Context,
) -> String

Convert a schema object to a Gleam type string. Delegates to schema_dispatch for the centralized type mapping.

Search Document