BlueBird v0.3.2 BlueBird.Generator

Generates a map containing information about the api routes.

BlueBird.Generator uses the connections logged by BlueBird.ConnLogger and the functions generated by the BlueBird.Controller.api/3 macro to generate a map containing all the data that is needed to generate the doc file.

It is called when BlueBird.Formatter receives the :suite_finished event by ExUnit and immediately piped to BlueBird.BlueprintWriter to write the documentation to file.

Link to this section Summary

Functions

Generates a map from logged connections and the api/3 macros

Link to this section Functions

Generates a map from logged connections and the api/3 macros.

Example response

%BlueBird.ApiDoc{
  description: "Enter API description in mix.exs - blue_bird_info",
  host: "http://localhost",
  routes: [
    %BlueBird.Route{
      description: "Gets a single user.",
      group: "Users",
      method: "GET",
      note: nil,
      parameters: [
        %BlueBird.Parameter{
          description: "ID",
          name: "id",
          type: "int"
        }
      ],
      path: "/users/:id",
      title: "Get single user",
      warning: nil,
      requests: [
        %BlueBird.Request{
          body_params: %{},
          headers: [{"accept", "application/json"}],
          method: "GET",
          path: "/user/:id",
          path_params: %{"id" => 1},
          query_params: %{},
          response: %BlueBird.Response{
            body: "{\"status\":\"ok\"}",
            headers: [{"content-type", "application/json"}],
            status: 200
          }
        }
      ]
    }
  ]
}