2018-04-29 12:25:56 +00:00
|
|
|
# Ring with Swagger example
|
2018-04-19 19:58:59 +00:00
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
|
|
```clj
|
|
|
|
|
> lein repl
|
2018-04-29 12:18:30 +00:00
|
|
|
(start)
|
2018-04-19 19:58:59 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
To test the endpoints using [httpie](https://httpie.org/):
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
http GET :3000/api/schema/plus x==1 y==20
|
|
|
|
|
http GET :3000/api/spec/plus x==1 y==20
|
|
|
|
|
|
|
|
|
|
http GET :3000/api/swagger.json
|
|
|
|
|
```
|
|
|
|
|
|
2018-04-29 12:18:30 +00:00
|
|
|
* swagger.json: http://localhost:3000/api/swagger.json
|
2018-04-29 13:49:05 +00:00
|
|
|
* swagger-ui: http://localhost:3000/api-docs/
|
2018-04-29 12:18:30 +00:00
|
|
|
|
2018-04-29 12:22:09 +00:00
|
|
|
<img src="https://raw.githubusercontent.com/metosin/reitit/master/examples/ring-swagger/swagger-ui.png" />
|
|
|
|
|
|
2018-04-19 19:58:59 +00:00
|
|
|
## License
|
|
|
|
|
|
2018-05-20 18:45:11 +00:00
|
|
|
Copyright © 2017-2018 Metosin Oy
|