howmuch/api/openapi/openapi.yaml
2024-10-05 18:02:42 +02:00

100 lines
2.8 KiB
YAML

# 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.
swagger: "2.0"
openapi: 3.1.0
info:
title: Howmuch Expense-sharing app
description: |-
A simple web application that can help you share your expense with your
friends.
contact:
email: vinchent@vinchent.xyz
license:
name: MIT
url: https://opensource.org/license/MIT
version: '0.0.1'
servers:
- url: https:/localhost:8000/v1
tags:
- name: user
paths:
/signup:
post:
tags:
- user
description: Sign up as a new user
requestBody:
description: Sign up
content:
application/json:
schema:
$ref: '#/components/schemas/UserSignUpRequest'
responses:
'200':
description: Successful operation
'400':
description: Client side error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrResponse'
'500':
description: Server side error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrResponse'
components:
schemas:
UserSignUpRequest:
type: object
properties:
email:
type: string
example: bruce@wayne.com
first_name:
type: string
example: Bruce
last_name:
type: string
example: Wayne
password:
type: string
example: verystrongpassword
required:
- email
- fist_name
- last_name
- password
ErrResponse:
type: object
properties:
code:
type: string
example: FailedOperation.UserAlreadyExists
message:
type: string
example: "User already exists."