oaspec/codegen/schema_utils

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 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_nullable(
  ref: schema.SchemaRef,
  ctx: context.Context,
) -> Bool

Check if a SchemaRef is nullable, resolving $ref if needed.

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.

Search Document