OpenAPI spec including transactions and banks
This commit is contained in:
parent
d449a30afa
commit
431e7ea4c6
152
docs/openapi.yaml
Normal file
152
docs/openapi.yaml
Normal file
@ -0,0 +1,152 @@
|
|||||||
|
openapi: 3.0.3
|
||||||
|
info:
|
||||||
|
title: Personal Finance - OpenAPI 3.0
|
||||||
|
description: |
|
||||||
|
Personal Finance Server
|
||||||
|
contact:
|
||||||
|
email: finance@murta.dev
|
||||||
|
license:
|
||||||
|
name: GNU General Public License v3.0 or later
|
||||||
|
url: https://www.gnu.org/licenses/gpl-3.0-standalone.html
|
||||||
|
version: 0.0.1
|
||||||
|
|
||||||
|
paths:
|
||||||
|
/transactions:
|
||||||
|
get:
|
||||||
|
summary: Retrieve existing transactions
|
||||||
|
operationId: retrieveTransactions
|
||||||
|
parameters:
|
||||||
|
- name: limit
|
||||||
|
in: query
|
||||||
|
description: number of transactions to return
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
format: int32
|
||||||
|
default: 100
|
||||||
|
minimum: 0
|
||||||
|
- name: offset
|
||||||
|
in: query
|
||||||
|
description: offset from where to retrieve transactions
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
format: int32
|
||||||
|
default: -1
|
||||||
|
- name: bank
|
||||||
|
in: query
|
||||||
|
description: ID of the bank
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- name: sort
|
||||||
|
in: query
|
||||||
|
description: field name by which to sort
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: Successful operation
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/Transactions"
|
||||||
|
"404":
|
||||||
|
description: No transactions
|
||||||
|
|
||||||
|
/transactions/{transactionId}:
|
||||||
|
get:
|
||||||
|
summary: Find transaction by ID
|
||||||
|
operationId: retrieveTransactions
|
||||||
|
parameters:
|
||||||
|
- name: transactionId
|
||||||
|
in: path
|
||||||
|
description: ID of transaction to return
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: Successful operation
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/Transaction"
|
||||||
|
"400":
|
||||||
|
description: Invalid ID supplied
|
||||||
|
"404":
|
||||||
|
description: Transaction not found
|
||||||
|
|
||||||
|
/banks:
|
||||||
|
get:
|
||||||
|
summary: Retrieve existing banks
|
||||||
|
operationId: retrieveBanks
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: Successful operation
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/Banks"
|
||||||
|
"404":
|
||||||
|
description: No banks
|
||||||
|
|
||||||
|
/banks/{bankId}:
|
||||||
|
get:
|
||||||
|
summary: Find bank by ID
|
||||||
|
operationId: retrieveBank
|
||||||
|
parameters:
|
||||||
|
- name: bankId
|
||||||
|
in: path
|
||||||
|
description: ID of bank to return
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: Successful operation
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/Bank"
|
||||||
|
"400":
|
||||||
|
description: Invalid ID supplied
|
||||||
|
"404":
|
||||||
|
description: Bank not found
|
||||||
|
|
||||||
|
components:
|
||||||
|
schemas:
|
||||||
|
Transaction:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
minimum: 0
|
||||||
|
date:
|
||||||
|
type: string
|
||||||
|
format: date
|
||||||
|
description:
|
||||||
|
type: string
|
||||||
|
value:
|
||||||
|
type: number
|
||||||
|
format: float
|
||||||
|
category:
|
||||||
|
type: string
|
||||||
|
Transactions:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: "#/components/schemas/Transaction"
|
||||||
|
Bank:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
nordigenId:
|
||||||
|
type: string
|
||||||
|
format: uuid
|
||||||
|
Banks:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: "#/components/schemas/Bank"
|
||||||
Loading…
x
Reference in New Issue
Block a user