Add required properties to objects

This commit is contained in:
Luís Murta 2024-02-05 23:21:18 +00:00
parent ff093b59d5
commit b9c51c9dbf
Signed by: satprog
GPG Key ID: 169EF1BBD7049F94
2 changed files with 10 additions and 2 deletions

View File

@ -13,14 +13,14 @@ type Transaction struct {
Date string `json:"date"` Date string `json:"date"`
Description string `json:"description"` Description string `json:"description"`
Value float64 `json:"value"` Value float64 `json:"value"`
Category string `json:"category"` Category string `json:"category,omitempty"`
} }
// Bank struct represents a bank // Bank struct represents a bank
type Bank struct { type Bank struct {
ID string `json:"id"` ID string `json:"id"`
Name string `json:"name"` Name string `json:"name"`
NordigenID string `json:"nordigenId"` NordigenID string `json:"nordigenId,omitempty"`
} }
// ResponseError struct represents an error response // ResponseError struct represents an error response

View File

@ -132,6 +132,11 @@ components:
format: float format: float
category: category:
type: string type: string
required:
- id
- date
- description
- value
Transactions: Transactions:
type: array type: array
items: items:
@ -146,6 +151,9 @@ components:
nordigenId: nordigenId:
type: string type: string
format: uuid format: uuid
required:
- id
- name
Banks: Banks:
type: array type: array
items: items: