style: format openapi

This commit is contained in:
Bastien Riviere 2024-01-29 22:23:23 +01:00
parent e4f760f4c2
commit 8d29ab9a9c
Signed by: babariviere
GPG key ID: 4E5F0839249F162E
2 changed files with 6 additions and 8 deletions

View file

@ -4,8 +4,6 @@
package db
import ()
type Url struct {
ID int32
Hash string

View file

@ -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: