radex v0.1.0 Radex.Writer.JSON.Example View Source
Generate example files
Link to this section Summary
Functions
Generate an example
Generate a header from a Conn tuple
Generates a map of headers
Generate a single paramter
Generate parameters from the metadata
Generate a single request map from a Radex.Conn
Generate response map from a Radex.Conn
Generate and write the example files
Generate and write a single example file
Link to this section Functions
Generate an example
Generate a header from a Conn tuple
Will properly capitalize the header
Generates a map of headers
iex> Example.generate_headers([{"content-type", "application/json"}, {"accept", "application/json"}])
%{"Content-Type" => "application/json", "Accept" => "application/json"}
Generate a single paramter
iex> Example.generate_parameter({"name", "description"})
%{name: "name", description: "description"}
iex> Example.generate_parameter({"name", "description", extra: :keys})
%{name: "name", description: "description", extra: :keys}
Generate parameters from the metadata
iex> Example.generate_parameters([{"name", "description"}])
[%{name: "name", description: "description"}]
Generate a single request map from a Radex.Conn
Link to this function
generate_requests(list)
View Source
generate_requests([Radex.Conn.t]) :: [map]
Generate response map from a Radex.Conn
Generate and write the example files
Generate and write a single example file