https://github.com/smartlogic/radex
Generate API Documentation through ExUnit
https://github.com/smartlogic/radex
Last synced: 11 months ago
JSON representation
Generate API Documentation through ExUnit
- Host: GitHub
- URL: https://github.com/smartlogic/radex
- Owner: smartlogic
- License: mit
- Created: 2017-10-05T19:20:30.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-12T17:13:07.000Z (over 8 years ago)
- Last Synced: 2025-07-29T00:47:51.628Z (11 months ago)
- Language: Elixir
- Size: 41 KB
- Stars: 3
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Radex
[](https://travis-ci.org/smartlogic/radex)
A utility to generate documentation for your web API via tests.
## Installation
```elixir
# mix.exs
defp deps do
[
{:radex, "~> 0.1.0", only: :test},
]
end
# You can also set up an alias for the formatter
# This must be run with MIX_ENV=test explicitly declared
defp aliases do
[
"radex.test": ["test --formatter Radex.Formatter"],
]
end
```
## Usage
An example test:
```elixir
defmodule AppWeb.OrderControllerTest do
use AppWeb.ConnCase
describe "creating" do
use Radex.Endpoint
@resource "Orders"
@route {"POST", "/orders"}
@parameter {"location", "Order Location", type: :string}
test "Creating an Order", %{conn: conn} do
conn =
conn
|> post(order_path(conn, :create), %{name: "Cafe"})
|> record()
assert conn.status == 201
end
end
end
```
Record documentation by using the Radex formatter:
```
mix test --formatter Radex.Formatter
MIX_ENV=test mix radex.test
```
## Configuration
```elixir
# config/test.exs
config :radex,
path: "docs"
```