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
|
package db
|
||||||
|
|
||||||
import ()
|
|
||||||
|
|
||||||
type Url struct {
|
type Url struct {
|
||||||
ID int32
|
ID int32
|
||||||
Hash string
|
Hash string
|
||||||
|
|
12
openapi.yaml
12
openapi.yaml
|
@ -4,17 +4,17 @@ info:
|
||||||
version: 0.1.0
|
version: 0.1.0
|
||||||
description: An URL shortener service.
|
description: An URL shortener service.
|
||||||
paths:
|
paths:
|
||||||
'/{hash}':
|
"/{hash}":
|
||||||
get:
|
get:
|
||||||
responses:
|
responses:
|
||||||
'307':
|
"307":
|
||||||
description: Redirect client to long URL.
|
description: Redirect client to long URL.
|
||||||
headers:
|
headers:
|
||||||
Location:
|
Location:
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
description: Long URL
|
description: Long URL
|
||||||
'404':
|
"404":
|
||||||
description: Not Found
|
description: Not Found
|
||||||
description: Redirect client to long URL.
|
description: Redirect client to long URL.
|
||||||
operationId: redirectLongURL
|
operationId: redirectLongURL
|
||||||
|
@ -38,11 +38,11 @@ paths:
|
||||||
url:
|
url:
|
||||||
type: string
|
type: string
|
||||||
description: URL to shorten
|
description: URL to shorten
|
||||||
example: 'https://example.com'
|
example: "https://example.com"
|
||||||
required:
|
required:
|
||||||
- url
|
- url
|
||||||
responses:
|
responses:
|
||||||
'201':
|
"201":
|
||||||
description: Succesfully created shorten URL.
|
description: Succesfully created shorten URL.
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
|
@ -54,7 +54,7 @@ paths:
|
||||||
description: Created shorten URL. Going to this URL should redirect to URL from request body.
|
description: Created shorten URL. Going to this URL should redirect to URL from request body.
|
||||||
required:
|
required:
|
||||||
- shorten
|
- shorten
|
||||||
'400':
|
"400":
|
||||||
description: Bad Request
|
description: Bad Request
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
|
|
Loading…
Reference in a new issue