Skip to content

Commit a918a54

Browse files
authored
Merge pull request #26 from Frameio/develop
Release 2/19 (v0.4.1)
2 parents 987fe80 + 405749d commit a918a54

4 files changed

Lines changed: 41 additions & 56 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ deps in `mix.exs`:
2525
```elixir
2626
def deps do
2727
[
28-
{:rolodex, "~> 0.1.0"}
28+
{:rolodex, "~> 0.4.1"}
2929
]
3030
end
3131
```

lib/rolodex/config.ex

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@ defmodule Rolodex.Config do
2525
2626
## Example
2727
28-
config :rolodex,
29-
title: "MyApp",
30-
description: "An example",
31-
version: "1.0.0",
32-
router: MyRouter,
33-
processor: Rolodex.Processors.Swagger,
34-
writer: [
35-
file_name: "my_docs.json",
36-
module: Rolodex.Writers.FileWriter
37-
],
38-
pipelines: [
39-
api: [
40-
headers: %{"X-Request-Id" => :uuid}
28+
config :rolodex,
29+
title: "MyApp",
30+
description: "An example",
31+
version: "1.0.0",
32+
router: MyRouter,
33+
processor: Rolodex.Processors.Swagger,
34+
writer: [
35+
file_name: "my_docs.json",
36+
module: Rolodex.Writers.FileWriter
37+
],
38+
pipelines: [
39+
api: [
40+
headers: %{"X-Request-Id" => :uuid}
41+
]
4142
]
42-
]
4343
4444
"""
4545

@@ -144,11 +144,11 @@ defmodule Rolodex.PipelineConfig do
144144
145145
## Example
146146
147-
%Rolodex.PipelineConfig{
148-
body: %{id: :uuid, name: :string}
149-
headers: %{"X-Request-Id" => :uuid},
150-
query_params: %{account_id: :uuid}
151-
}
147+
%Rolodex.PipelineConfig{
148+
body: %{id: :uuid, name: :string}
149+
headers: %{"X-Request-Id" => :uuid},
150+
query_params: %{account_id: :uuid}
151+
}
152152
"""
153153

154154
defstruct body: %{},

lib/rolodex/route.ex

Lines changed: 20 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
defmodule Rolodex.Route do
22
@moduledoc """
3-
Collects metadata associated with an API route. `new/2` takes in a
4-
`Phoenix.Router.Route`, finds the controller action function associated with
5-
the route, and collects metadata set in the `@doc` annotations for the function.
3+
Collects metadata associated with an API route.
64
7-
## Route Annotations
5+
`new/2` takes a `Phoenix.Router.Route`, finds the controller action
6+
function associated with the route, and collects metadata set in the `@doc`
7+
annotations for the function.
88
9-
Details about all the valid annotations that `new/2` will look for. Each one has
10-
a default, so they each can be omitted if not needed for the current route.
9+
### Fields
1110
12-
**`desc`**
13-
14-
Default: `""`
11+
* **`desc`** (Default: `""`)
1512
1613
Set via an `@doc` comment
1714
@@ -21,9 +18,7 @@ defmodule Rolodex.Route do
2118
@doc "My route description"
2219
def route(_, _), do: nil
2320
24-
**`body`**
25-
26-
Default: `%{}`
21+
* **`body`** *(Default: `%{}`)
2722
2823
Request body parameters. Valid inputs: `Rolodex.Schema`, a map, or a list.
2924
@@ -63,9 +58,7 @@ defmodule Rolodex.Route do
6358
]
6459
]
6560
66-
**`headers`**
67-
68-
Default: `%{}`
61+
* **`headers`** (Default: `%{}`)
6962
7063
Request headers. Valid input is a map or keyword list, where each key is a
7164
header name and each value is a description of the value in the form of a
@@ -110,16 +103,15 @@ defmodule Rolodex.Route do
110103
]
111104
]
112105
113-
**`path_params`**
114-
115-
Default: `%{}`
106+
* **`path_params`** (Default: `%{}`)
116107
117108
Parameters in the route path. Valid input is a map or keyword list, where each
118-
key is a path parameter name and each value is a description of the value in the
119-
form of a `Rolodex.Schema`, an atom, a map, or a list.
109+
key is a path parameter name and each value is a description of the value in
110+
the form of a `Rolodex.Schema`, an atom, a map, or a list.
120111
121-
Each parameter value can also specify the following: `minimum` (default: `nil`),
122-
`maximum` (default: `nil`), default (default: `nil`), and required (default: `required`).
112+
Each parameter value can also specify the following: `minimum` (default:
113+
`nil`), `maximum` (default: `nil`), default (default: `nil`), and required
114+
(default: `required`).
123115
124116
@doc [
125117
# Simplest path parameter description: a name with a concrete type
@@ -147,16 +139,15 @@ defmodule Rolodex.Route do
147139
]
148140
]
149141
150-
**`query_params`**
151-
152-
Default: `%{}`
142+
* **`query_params`** (Default: `%{}`)
153143
154144
Query parameters. Valid input is a map or keyword list, where each key is a
155145
query parameter name and each value is a description of the value in the form
156146
of a `Rolodex.Schema`, an atom, a map, or a list.
157147
158148
Each query value can also specify the following: `minimum` (default: `nil`),
159-
`maximum` (default: `nil`), default (default: `nil`), and required (default: `required`).
149+
`maximum` (default: `nil`), default (default: `nil`), and required (default:
150+
`required`).
160151
161152
@doc [
162153
# Simplest query parameter description: a name with a concrete type
@@ -194,9 +185,7 @@ defmodule Rolodex.Route do
194185
]
195186
]
196187
197-
**`responses`**
198-
199-
Default: `%{}`
188+
* **`responses`** (Default: `%{}`)
200189
201190
Response(s) for the route action. Valid input is a map or keyword list, where
202191
each key is a response code and each value is a description of the response in
@@ -240,15 +229,11 @@ defmodule Rolodex.Route do
240229
}
241230
]
242231
243-
**`metadata`**
244-
245-
Default: `%{}`
232+
* **`metadata`** (Default: `%{}`)
246233
247234
Any metadata for the route. Valid input is a map or keyword list.
248235
249-
**`tags`**
250-
251-
Default: `[]`
236+
* **`tags`** (Default: `[]`)
252237
253238
Route tags. Valid input is a list of strings.
254239

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ defmodule Rolodex.MixProject do
66
app: :rolodex,
77
name: "Rolodex",
88
description: "Automated docs generation",
9-
version: "0.4.0",
9+
version: "0.4.1",
1010
elixir: "~> 1.7",
1111
elixirc_paths: elixirc_paths(Mix.env()),
1212
start_permanent: Mix.env() == :prod,

0 commit comments

Comments
 (0)