howmuch/api/openapi/openapi.yaml

100 lines
2.8 KiB
YAML
Raw Normal View History

# MIT License
#
# Copyright (c) 2024 vinchent <vinchent@vinchent.xyz>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
2024-09-30 21:00:34 +00:00
swagger: "2.0"
2024-10-05 16:00:01 +00:00
openapi: 3.1.0
2024-09-30 21:00:34 +00:00
info:
2024-10-05 16:00:01 +00:00
title: Howmuch Expense-sharing app
2024-09-30 21:00:34 +00:00
description: |-
A simple web application that can help you share your expense with your
friends.
contact:
2024-10-05 16:00:01 +00:00
email: vinchent@vinchent.xyz
2024-09-30 21:00:34 +00:00
license:
name: MIT
url: https://opensource.org/license/MIT
2024-10-05 16:00:01 +00:00
version: '0.0.1'
2024-09-30 21:00:34 +00:00
servers:
2024-10-05 16:00:01 +00:00
- url: https:/localhost:8000/v1
2024-09-30 21:00:34 +00:00
tags:
- name: user
2024-10-05 16:00:01 +00:00
2024-09-30 21:00:34 +00:00
paths:
2024-10-05 16:00:01 +00:00
/signup:
2024-09-30 21:00:34 +00:00
post:
tags:
- user
2024-10-05 16:00:01 +00:00
description: Sign up as a new user
2024-09-30 21:00:34 +00:00
requestBody:
2024-10-05 16:00:01 +00:00
description: Sign up
2024-09-30 21:00:34 +00:00
content:
application/json:
schema:
2024-10-05 16:00:01 +00:00
$ref: '#/components/schemas/UserSignUpRequest'
2024-09-30 21:00:34 +00:00
responses:
'200':
description: Successful operation
2024-10-05 16:00:01 +00:00
'400':
description: Client side error
2024-09-30 21:00:34 +00:00
content:
application/json:
schema:
2024-10-05 16:00:01 +00:00
$ref: '#/components/schemas/ErrResponse'
'500':
description: Server side error
2024-09-30 21:00:34 +00:00
content:
application/json:
schema:
2024-10-05 16:00:01 +00:00
$ref: '#/components/schemas/ErrResponse'
2024-09-30 21:00:34 +00:00
components:
schemas:
2024-10-05 16:00:01 +00:00
UserSignUpRequest:
2024-09-30 21:00:34 +00:00
type: object
properties:
email:
type: string
2024-10-05 16:00:01 +00:00
example: bruce@wayne.com
first_name:
2024-09-30 21:00:34 +00:00
type: string
2024-10-05 16:00:01 +00:00
example: Bruce
last_name:
2024-09-30 21:00:34 +00:00
type: string
2024-10-05 16:00:01 +00:00
example: Wayne
password:
2024-09-30 21:00:34 +00:00
type: string
2024-10-05 16:00:01 +00:00
example: verystrongpassword
2024-09-30 21:00:34 +00:00
required:
2024-10-05 16:00:01 +00:00
- email
- fist_name
- last_name
- password
ErrResponse:
2024-09-30 21:00:34 +00:00
type: object
properties:
code:
type: string
2024-10-05 16:00:01 +00:00
example: FailedOperation.UserAlreadyExists
2024-09-30 21:00:34 +00:00
message:
type: string
2024-10-05 16:00:01 +00:00
example: "User already exists."