mirror of
https://github.com/metosin/reitit.git
synced 2025-12-16 16:01:11 +00:00
doc: openapi in examples/http-swagger
This commit is contained in:
parent
2cc6e33654
commit
52b7402575
2 changed files with 15 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
|||
# Http with Swagger example
|
||||
# Http with Swagger/OpenAPI example
|
||||
|
||||
## Usage
|
||||
|
||||
|
|
@ -7,6 +7,10 @@
|
|||
(start)
|
||||
```
|
||||
|
||||
- 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/>
|
||||
|
||||
To test the endpoints using [httpie](https://httpie.org/):
|
||||
|
||||
```bash
|
||||
|
|
@ -20,4 +24,4 @@ http GET :3000/async results==1 seed==reitit
|
|||
|
||||
## License
|
||||
|
||||
Copyright © 2018 Metosin Oy
|
||||
Copyright © 2018-2023 Metosin Oy
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
[reitit.coercion.spec]
|
||||
[reitit.swagger :as swagger]
|
||||
[reitit.swagger-ui :as swagger-ui]
|
||||
[reitit.openapi :as openapi]
|
||||
[reitit.http.coercion :as coercion]
|
||||
[reitit.dev.pretty :as pretty]
|
||||
[reitit.interceptor.sieppari :as sieppari]
|
||||
|
|
@ -44,6 +45,14 @@
|
|||
:swagger {:info {:title "my-api"
|
||||
:description "with reitit-http"}}
|
||||
:handler (swagger/create-swagger-handler)}}]
|
||||
["/openapi.json"
|
||||
{:get {:no-doc true
|
||||
;; TODO swagger-ui hasn't released support for OAS 3.1 yet, so we pretend it's 3.0
|
||||
:openapi {:openapi "3.0.0"
|
||||
:info {:title "my-api"
|
||||
:description "with reitit-http"
|
||||
:version "0.0.1"}}
|
||||
:handler (openapi/create-openapi-handler)}}]
|
||||
|
||||
["/files"
|
||||
{:swagger {:tags ["files"]}}
|
||||
|
|
|
|||
Loading…
Reference in a new issue