View Source OpenAPI.Renderer.State (OpenAPI Generator v0.1.0-rc.4)
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 associatedOpenAPI.Renderer.File.t/0
structs. This map is built using theoperations
andschemas
data.implementation
: Module configured as the implementation of the renderer (defaults toOpenAPI.Renderer
). Callbacks must use this field when calling other render callbacks.operations
: List ofOpenAPI.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 theirOpenAPI.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.
Link to this section Summary
Link to this section 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.