BlueBird v0.4.0 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
Link to this section Functions
Link to this function
run()
run()
run() :: BlueBird.ApiDoc.t()
run() :: BlueBird.ApiDoc.t()
Generates a map from logged connections and the api/3
macros.
Example response
%BlueBird.ApiDoc{
title: "The API",
description: "Enter API description in mix.exs - blue_bird_info",
terms_of_service: "Use on your own risk.",
host: "http://localhost",
contact: %{
name: "Henry",
url: "https://henry.something",
email: "mail@henry.something"
},
license: %{
name: "Apache 2.0",
url: "https://www.apache.org/licenses/LICENSE-2.0"
},
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
}
}
]
}
]
}