View Source OpenAPI.Renderer.State (OpenAPI Generator v0.2.0)

State of the render phase of code generation

This struct is created at the beginning of the render phase using data from the overall generator OpenAPI.State. It has the following fields:

  • files: Map of module names and their associated OpenAPI.Renderer.File.t/0 structs. This map is built using the operations and schemas data.
  • implementation: Module configured as the implementation of the renderer (defaults to OpenAPI.Renderer). Callbacks must use this field when calling other render callbacks.
  • operations: List of OpenAPI.Processor.Operation.t/0 structs processed in the previous phase. These operations may appear in any order due to map key ordering.
  • profile: Name of the active configuration profile. Callbacks must use this field when looking up configuration from the application environment.
  • schemas: Map of schema references to their OpenAPI.Processor.Schema.t/0 structs processed in the previous phase. The reference-keyed map is included to make it easier for callbacks to look up a schema by its reference, as this is often how operations will refer to them.

All of this state is managed by the code generator, and it is unlikely that a callback would need to transform this struct directly.

Summary

Types

t()

Render phase state

Types

@type t() :: %OpenAPI.Renderer.State{
  files: %{required(module()) => OpenAPI.Renderer.File.t()},
  implementation: module(),
  operations: [OpenAPI.Processor.Operation.t()],
  profile: atom(),
  schemas: %{required(reference()) => OpenAPI.Processor.Schema.t()}
}

Render phase state

See module documentation for additional information.