Generates one module per named schema.
Objects become structs:
defmodule OpenAI.Schemas.ChatCompletion do
@moduledoc "..."
defstruct [:id, :choices, ..., __extra__: %{}, __present__: []]
@type t :: %__MODULE__{id: String.t(), choices: [OpenAI.Schemas.Choice.t()], ...}
def __schema__(:fields), do: [{:id, "id", :string}, ...]
def decode(json), do: Infusion.Runtime.Schema.decode_module(json, __MODULE__)
endOther schemas (enums, unions, arrays, scalars) get a module with a type,
so every reference works the same way. Decoding itself lives in
infusion_runtime; the generated code only describes the fields.
Summary
Functions
Renders every named schema of ir under base ("OpenAI"). Returns the
files and the schema-name-to-module mapping.