style: format openapi
This commit is contained in:
parent
e4f760f4c2
commit
8d29ab9a9c
2 changed files with 6 additions and 8 deletions
|
@ -4,8 +4,6 @@
|
|||
|
||||
package db
|
||||
|
||||
import ()
|
||||
|
||||
type Url struct {
|
||||
ID int32
|
||||
Hash string
|
||||
|
|
12
openapi.yaml
12
openapi.yaml
|
@ -4,17 +4,17 @@ info:
|
|||
version: 0.1.0
|
||||
description: An URL shortener service.
|
||||
paths:
|
||||
'/{hash}':
|
||||
"/{hash}":
|
||||
get:
|
||||
responses:
|
||||
'307':
|
||||
"307":
|
||||
description: Redirect client to long URL.
|
||||
headers:
|
||||
Location:
|
||||
schema:
|
||||
type: string
|
||||
description: Long URL
|
||||
'404':
|
||||
"404":
|
||||
description: Not Found
|
||||
description: Redirect client to long URL.
|
||||
operationId: redirectLongURL
|
||||
|
@ -38,11 +38,11 @@ paths:
|
|||
url:
|
||||
type: string
|
||||
description: URL to shorten
|
||||
example: 'https://example.com'
|
||||
example: "https://example.com"
|
||||
required:
|
||||
- url
|
||||
responses:
|
||||
'201':
|
||||
"201":
|
||||
description: Succesfully created shorten URL.
|
||||
content:
|
||||
application/json:
|
||||
|
@ -54,7 +54,7 @@ paths:
|
|||
description: Created shorten URL. Going to this URL should redirect to URL from request body.
|
||||
required:
|
||||
- shorten
|
||||
'400':
|
||||
"400":
|
||||
description: Bad Request
|
||||
content:
|
||||
application/json:
|
||||
|
|
Loading…
Reference in a new issue