Infusion.IR (infusion v0.1.0)

Copy Markdown View Source

The intermediate representation: what the code generator reads, instead of the spec. Built from a document that went through Infusion.Ref and Infusion.Normalize.

{:ok, ir} = Infusion.IR.build(document)
ir.operations  #=> [%Infusion.IR.Operation{module: ["Repos"], function: "get", ...}]
ir.schemas     #=> %{"Repository" => %Infusion.IR.Schema{kind: :object, ...}}
ir.warnings    #=> what could not be represented

Summary

Functions

Builds the IR. Never fails on unusual schemas: they become :any, with a warning.

Functions

build(document)

@spec build(map()) ::
  {:ok,
   %Infusion.IR{
     auth: term(),
     operations: term(),
     schemas: term(),
     servers: term(),
     warnings: term()
   }}

Builds the IR. Never fails on unusual schemas: they become :any, with a warning.