Torngen.Spec (Torngen v0.1.2)

View Source

An intermediate representation of the Torn API OpenAPI specification.

Summary

Types

t()

The internal representation of the OpenAPI specification.

Functions

Parse the decoded OpenAPI specification into this intermediate representation.

Types

t()

@type t() :: %Torngen.Spec{
  api_description: String.t() | nil,
  api_name: String.t() | nil,
  api_servers: [String.t()],
  api_version: String.t() | nil,
  open_api_version: String.t() | nil,
  parameters: [Torngen.Spec.Parameter.t()],
  paths: [Torngen.Spec.Path.t()],
  schemas: [Torngen.Spec.Schema.schema_types()]
}

The internal representation of the OpenAPI specification.

This IR will be utilized when performing the code generation while remaining language-agnostic.

Fields

  • open_api_version: The OpenAPI specification version
  • api_servers: List of base URIs for the API
  • api_name: Name of the API
  • api_description: Description for the API
  • api_version: Semver API versioning
  • parameters: Parsed API parameters
  • paths: Parsed API paths
  • schemas: Parsed API response schemas

Functions

parse(data)

@spec parse(data :: map()) :: t()

Parse the decoded OpenAPI specification into this intermediate representation.