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

Generates Elixir modules from parsed OpenAPI Path structs.

Groups paths by their first path segment and generates modules with functions for each operation.

Summary

Functions

Link to this function

generate_module(prefix, paths, schemas \\ %{})

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

Generates a single module from paths that share the same prefix.

Link to this function

generate_modules(paths, schemas \\ %{})

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

Generates modules from a list of Path structs.

Groups paths by their first path segment and returns a list of module ASTs.

Link to this function

get_response_schema(operation, status_code, schemas)

View Source
Link to this function

get_stream_response_schema(operation, status_code, schemas)

View Source