View Source ExOpenAI.Codegen.DocsParser.Schema (ex_openai.ex v2.0.0-beta2)

Represents an OpenAPI schema component.

Summary

Functions

Parses components section from OpenAPI specification.

Parses a single schema definition.

Types

Link to this type

discriminator_mapping_t()

View Source
@type discriminator_mapping_t() :: %{optional(String.t()) => String.t()}
@type discriminator_t() :: %{
  property_name: String.t() | nil,
  mapping: discriminator_mapping_t()
}
@type t() :: %ExOpenAI.Codegen.DocsParser.Schema{
  additional_properties: boolean() | map() | nil,
  all_of: [t()] | nil,
  any_of: [t()] | nil,
  default: any() | nil,
  deprecated: boolean() | nil,
  description: String.t() | nil,
  discriminator: discriminator_t() | nil,
  enum: [any()] | nil,
  example: any() | nil,
  format: String.t() | nil,
  items: t() | nil,
  name: String.t() | nil,
  nullable: boolean() | nil,
  one_of: [t()] | nil,
  properties: %{required(String.t()) => t()} | nil,
  raw: map() | nil,
  read_only: boolean() | nil,
  ref: String.t() | nil,
  required: [String.t()] | nil,
  type: String.t() | nil,
  write_only: boolean() | nil
}

Functions

Link to this function

parse_components(components)

View Source
@spec parse_components(map() | nil) :: %{required(String.t()) => t()}

Parses components section from OpenAPI specification.

Link to this function

parse_schema(name, data)

View Source
@spec parse_schema(String.t(), map()) :: t()

Parses a single schema definition.