2023-05-03 14:11:07 +00:00
|
|
|
# reitit-ring, clojure.spec, swagger, openapi 3
|
2018-09-05 10:14:58 +00:00
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
|
|
```clj
|
|
|
|
|
> lein repl
|
|
|
|
|
(start)
|
|
|
|
|
```
|
|
|
|
|
|
2023-05-03 14:11:07 +00:00
|
|
|
- Swagger spec served at <http://localhost:3000/swagger.json>
|
|
|
|
|
- Openapi spec served at <http://localhost:3000/openapi.json>
|
|
|
|
|
- Swagger UI served at <http://localhost:3000/>
|
|
|
|
|
|
2018-09-05 10:14:58 +00:00
|
|
|
To test the endpoints using [httpie](https://httpie.org/):
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
http GET :3000/math/plus x==1 y==20
|
2018-09-23 10:42:12 +00:00
|
|
|
http POST :3000/math/plus x:=1 y:=20
|
2018-09-05 10:14:58 +00:00
|
|
|
|
|
|
|
|
http GET :3000/swagger.json
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
<img src="https://raw.githubusercontent.com/metosin/reitit/master/examples/ring-spec-swagger/swagger.png" />
|
|
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
|
|
Copyright © 2017-2018 Metosin Oy
|