View Source OpenAPI.Processor.State (OpenAPI Generator v0.1.0-rc.0)
State of the process phase of code generation
This struct is created at the beginning of the process phase using data from the overall
generator OpenAPI.State
. It has the following fields:
implementation
: Module configured as the implementation of the processor (defaults toOpenAPI.Processor
). Callbacks must use this field when calling other process callbacks.operations
: Cumulative list ofOpenAPI.Processor.Operation.t/0
structs identified and processed so far.profile
: Name of the active configuration profile. Callbacks must use this field when looking up configuration from the application environment.schema_specs_by_ref
: Cumulative map of raw schema specifications keyed by the internalref
s used to refer to them in types.schema_refs_by_path
: Cumulative map of internalref
s used to refer to schemas keyed by the original paths where they could be found in the spec files.schemas_by_ref
: Cumulative map of processedOpenAPI.Processor.Schema.t/0
structs keyed by the internalref
s used to refer to them in types, as they are processed.spec
: The original parsed OpenAPI description.
All of this data 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
Functions
Get a schema reference by the last ref file/path
Add a schema spec to the processor state and generate a reference for it
Link to this section Types
@type t() :: %OpenAPI.Processor.State{ implementation: module(), operations: [OpenAPI.Processor.Operation.t()], profile: atom(), schema_refs_by_path: %{required(term()) => reference()}, schema_specs_by_ref: %{required(reference()) => OpenAPI.Spec.Schema.t()}, schemas_by_ref: %{required(reference()) => OpenAPI.Processor.Schema.t()}, spec: OpenAPI.Spec.t() }
Link to this section Functions
@spec get_schema_ref_by_path(t(), OpenAPI.Spec.Schema.t()) :: reference() | nil
Get a schema reference by the last ref file/path
@spec put_schema_spec(t(), OpenAPI.Spec.Schema.t()) :: {t(), reference()}
Add a schema spec to the processor state and generate a reference for it