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 package db
import ()
type Url struct { type Url struct {
ID int32 ID int32
Hash string Hash string

View file

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