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

Collection of operations and schemas that belong to the same file

As rendering occurs for a particular file, this struct will collect all of the necessary data to continue the process. It has the following fields:

  • ast: Once rendered, the Abstract Syntax Tree (AST), or quoted form, of the file contents. This AST may include additional formatting-related metadata.
  • contents: Once formatted, the iodata form of the file contents. This is what will be used by the default implementation of the write callback.
  • location: Once determined, the filesystem location (path) where the file is intended to be written.
  • module: Name of the Elixir module contained in the file.
  • operations: List of OpenAPI.Processor.Operation.t/0 contained in the file.
  • schemas: List of OpenAPI.Processor.Schema.t/0 contained in the file.

All of this state is managed by the code generator, so it is unlikely that callbacks would need to write to this struct directly.

Summary

Types

t()

File contents

Types

@type t() :: %OpenAPI.Renderer.File{
  ast: Macro.t() | nil,
  contents: iodata() | nil,
  location: String.t() | nil,
  module: module(),
  operations: [OpenAPI.Processor.Operation.t()],
  schemas: [OpenAPI.Processor.Schema.t()]
}

File contents

See module documentation for additional information.