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

Generates Elixir modules from parsed OpenAPI Schema structs.

Summary

Functions

Generates comprehensive module documentation including field descriptions.

Generates documentation for all fields in an object schema.

Generates an Elixir module from a Schema struct.

Functions

Link to this function

generate_comprehensive_moduledoc(schema)

View Source

Generates comprehensive module documentation including field descriptions.

For object schemas, this includes a fields section with details about each property. For non-object schemas, this provides type information.

Link to this function

generate_comprehensive_moduledoc(schema, schemas)

View Source
@spec generate_comprehensive_moduledoc(ExOpenAI.Codegen.DocsParser.Schema.t(), %{
  optional(String.t()) => ExOpenAI.Codegen.DocsParser.Schema.t()
}) :: String.t()
Link to this function

generate_fields_documentation(arg1, schemas)

View Source
@spec generate_fields_documentation(ExOpenAI.Codegen.DocsParser.Schema.t(), %{
  optional(String.t()) => ExOpenAI.Codegen.DocsParser.Schema.t()
}) :: String.t()

Generates documentation for all fields in an object schema.

Returns a formatted string with field names, types, requirements, and descriptions.

Link to this function

generate_module(schema, schemas \\ %{})

View Source
@spec generate_module(ExOpenAI.Codegen.DocsParser.Schema.t(), %{
  required(String.t()) => ExOpenAI.Codegen.DocsParser.Schema.t()
}) :: Macro.t()

Generates an Elixir module from a Schema struct.

Takes a parsed Schema and returns the AST for a module definition. For allOf schemas, it first resolves/merges them before checking if they're objects.