WardrikRest.Spec (wardrik_rest v0.1.0-rc.1)

Copy Markdown

What a WardrikRest.Reader reads from an API's description: its operations and the ways it takes credentials.

  • :schemes - each scheme by its name in the description, as %{"oauth2" => :bearer}.
  • :operations - every operation, as WardrikRest.Operations.
  • :types - JSON Schemas by name. Any schema in the spec may refer to one as %{"$ref" => "Campaign"}, and a type's fields may have descriptions.

Summary

Types

Where a scheme puts its secret: :bearer for Authorization: Bearer ..., or a named header or query parameter.

t()

Types

place()

@type place() :: :bearer | {:header, String.t()} | {:query, String.t()}

Where a scheme puts its secret: :bearer for Authorization: Bearer ..., or a named header or query parameter.

t()

@type t() :: %WardrikRest.Spec{
  operations: [WardrikRest.Operation.t()],
  schemes: %{required(String.t()) => place()},
  title: String.t(),
  types: %{required(String.t()) => map()}
}