mirror of
https://github.com/we-promise/sure.git
synced 2026-04-07 14:31:25 +00:00
FIX OpenAPI auth specs (#722)
* FIX auth specs * FIX header params are not required with auth spec * Add missing endpoints
This commit is contained in:
@@ -11,10 +11,11 @@ servers:
|
||||
description: Local development
|
||||
components:
|
||||
securitySchemes:
|
||||
bearerAuth:
|
||||
type: http
|
||||
scheme: bearer
|
||||
bearerFormat: JWT
|
||||
apiKeyAuth:
|
||||
type: apiKey
|
||||
name: X-Api-Key
|
||||
in: header
|
||||
description: API key for authentication. Generate one from your account settings.
|
||||
schemas:
|
||||
Pagination:
|
||||
type: object
|
||||
@@ -222,6 +223,41 @@ components:
|
||||
type: string
|
||||
account_type:
|
||||
type: string
|
||||
AccountDetail:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- name
|
||||
- balance
|
||||
- currency
|
||||
- classification
|
||||
- account_type
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
format: uuid
|
||||
name:
|
||||
type: string
|
||||
balance:
|
||||
type: string
|
||||
currency:
|
||||
type: string
|
||||
classification:
|
||||
type: string
|
||||
account_type:
|
||||
type: string
|
||||
AccountCollection:
|
||||
type: object
|
||||
required:
|
||||
- accounts
|
||||
- pagination
|
||||
properties:
|
||||
accounts:
|
||||
type: array
|
||||
items:
|
||||
"$ref": "#/components/schemas/AccountDetail"
|
||||
pagination:
|
||||
"$ref": "#/components/schemas/Pagination"
|
||||
Category:
|
||||
type: object
|
||||
required:
|
||||
@@ -328,6 +364,32 @@ components:
|
||||
type: string
|
||||
color:
|
||||
type: string
|
||||
TagDetail:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- name
|
||||
- color
|
||||
- created_at
|
||||
- updated_at
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
format: uuid
|
||||
name:
|
||||
type: string
|
||||
color:
|
||||
type: string
|
||||
created_at:
|
||||
type: string
|
||||
format: date-time
|
||||
updated_at:
|
||||
type: string
|
||||
format: date-time
|
||||
TagCollection:
|
||||
type: array
|
||||
items:
|
||||
"$ref": "#/components/schemas/TagDetail"
|
||||
Transfer:
|
||||
type: object
|
||||
required:
|
||||
@@ -596,20 +658,41 @@ components:
|
||||
data:
|
||||
"$ref": "#/components/schemas/ImportDetail"
|
||||
paths:
|
||||
"/api/v1/accounts":
|
||||
get:
|
||||
summary: List accounts
|
||||
tags:
|
||||
- Accounts
|
||||
security:
|
||||
- apiKeyAuth: []
|
||||
parameters:
|
||||
- name: page
|
||||
in: query
|
||||
required: false
|
||||
description: 'Page number (default: 1)'
|
||||
schema:
|
||||
type: integer
|
||||
- name: per_page
|
||||
in: query
|
||||
required: false
|
||||
description: 'Items per page (default: 25, max: 100)'
|
||||
schema:
|
||||
type: integer
|
||||
responses:
|
||||
'200':
|
||||
description: accounts paginated
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
"$ref": "#/components/schemas/AccountCollection"
|
||||
"/api/v1/categories":
|
||||
get:
|
||||
summary: List categories
|
||||
tags:
|
||||
- Categories
|
||||
security:
|
||||
- bearerAuth: []
|
||||
- apiKeyAuth: []
|
||||
parameters:
|
||||
- name: Authorization
|
||||
in: header
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: Bearer token with read scope
|
||||
- name: page
|
||||
in: query
|
||||
required: false
|
||||
@@ -653,12 +736,6 @@ paths:
|
||||
"$ref": "#/components/schemas/CategoryCollection"
|
||||
"/api/v1/categories/{id}":
|
||||
parameters:
|
||||
- name: Authorization
|
||||
in: header
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: Bearer token with read scope
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
@@ -670,7 +747,7 @@ paths:
|
||||
tags:
|
||||
- Categories
|
||||
security:
|
||||
- bearerAuth: []
|
||||
- apiKeyAuth: []
|
||||
responses:
|
||||
'200':
|
||||
description: subcategory retrieved with parent
|
||||
@@ -690,14 +767,7 @@ paths:
|
||||
tags:
|
||||
- Chats
|
||||
security:
|
||||
- bearerAuth: []
|
||||
parameters:
|
||||
- name: Authorization
|
||||
in: header
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: Bearer token with read scope
|
||||
- apiKeyAuth: []
|
||||
responses:
|
||||
'200':
|
||||
description: chats listed
|
||||
@@ -716,14 +786,8 @@ paths:
|
||||
tags:
|
||||
- Chats
|
||||
security:
|
||||
- bearerAuth: []
|
||||
parameters:
|
||||
- name: Authorization
|
||||
in: header
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: Bearer token with write scope
|
||||
- apiKeyAuth: []
|
||||
parameters: []
|
||||
responses:
|
||||
'201':
|
||||
description: chat created
|
||||
@@ -757,12 +821,6 @@ paths:
|
||||
required: true
|
||||
"/api/v1/chats/{id}":
|
||||
parameters:
|
||||
- name: Authorization
|
||||
in: header
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: Bearer token with read scope
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
@@ -774,7 +832,7 @@ paths:
|
||||
tags:
|
||||
- Chats
|
||||
security:
|
||||
- bearerAuth: []
|
||||
- apiKeyAuth: []
|
||||
responses:
|
||||
'200':
|
||||
description: chat retrieved
|
||||
@@ -793,7 +851,7 @@ paths:
|
||||
tags:
|
||||
- Chats
|
||||
security:
|
||||
- bearerAuth: []
|
||||
- apiKeyAuth: []
|
||||
parameters: []
|
||||
responses:
|
||||
'200':
|
||||
@@ -829,7 +887,7 @@ paths:
|
||||
tags:
|
||||
- Chats
|
||||
security:
|
||||
- bearerAuth: []
|
||||
- apiKeyAuth: []
|
||||
responses:
|
||||
'204':
|
||||
description: chat deleted
|
||||
@@ -837,12 +895,6 @@ paths:
|
||||
description: chat not found
|
||||
"/api/v1/chats/{chat_id}/messages":
|
||||
parameters:
|
||||
- name: Authorization
|
||||
in: header
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: Bearer token with write scope
|
||||
- name: chat_id
|
||||
in: path
|
||||
required: true
|
||||
@@ -854,7 +906,7 @@ paths:
|
||||
tags:
|
||||
- Chat Messages
|
||||
security:
|
||||
- bearerAuth: []
|
||||
- apiKeyAuth: []
|
||||
parameters: []
|
||||
responses:
|
||||
'201':
|
||||
@@ -890,12 +942,6 @@ paths:
|
||||
required: true
|
||||
"/api/v1/chats/{chat_id}/messages/retry":
|
||||
parameters:
|
||||
- name: Authorization
|
||||
in: header
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: Bearer token with write scope
|
||||
- name: chat_id
|
||||
in: path
|
||||
required: true
|
||||
@@ -907,7 +953,7 @@ paths:
|
||||
tags:
|
||||
- Chat Messages
|
||||
security:
|
||||
- bearerAuth: []
|
||||
- apiKeyAuth: []
|
||||
responses:
|
||||
'202':
|
||||
description: retry started
|
||||
@@ -934,14 +980,8 @@ paths:
|
||||
tags:
|
||||
- Imports
|
||||
security:
|
||||
- bearerAuth: []
|
||||
- apiKeyAuth: []
|
||||
parameters:
|
||||
- name: Authorization
|
||||
in: header
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: Bearer token with read scope
|
||||
- name: page
|
||||
in: query
|
||||
required: false
|
||||
@@ -993,14 +1033,8 @@ paths:
|
||||
tags:
|
||||
- Imports
|
||||
security:
|
||||
- bearerAuth: []
|
||||
parameters:
|
||||
- name: Authorization
|
||||
in: header
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: Bearer token with write scope
|
||||
- apiKeyAuth: []
|
||||
parameters: []
|
||||
responses:
|
||||
'201':
|
||||
description: import created
|
||||
@@ -1085,12 +1119,6 @@ paths:
|
||||
required: true
|
||||
"/api/v1/imports/{id}":
|
||||
parameters:
|
||||
- name: Authorization
|
||||
in: header
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: Bearer token with read scope
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
@@ -1104,7 +1132,7 @@ paths:
|
||||
tags:
|
||||
- Imports
|
||||
security:
|
||||
- bearerAuth: []
|
||||
- apiKeyAuth: []
|
||||
responses:
|
||||
'200':
|
||||
description: import retrieved
|
||||
@@ -1118,20 +1146,141 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
"$ref": "#/components/schemas/ErrorResponse"
|
||||
"/api/v1/tags":
|
||||
get:
|
||||
summary: List tags
|
||||
tags:
|
||||
- Tags
|
||||
security:
|
||||
- apiKeyAuth: []
|
||||
responses:
|
||||
'200':
|
||||
description: tags listed
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
"$ref": "#/components/schemas/TagCollection"
|
||||
post:
|
||||
summary: Create tag
|
||||
tags:
|
||||
- Tags
|
||||
security:
|
||||
- apiKeyAuth: []
|
||||
parameters: []
|
||||
responses:
|
||||
'201':
|
||||
description: tag created with auto-assigned color
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
"$ref": "#/components/schemas/TagDetail"
|
||||
'422':
|
||||
description: validation error - missing name
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
"$ref": "#/components/schemas/ErrorResponse"
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
tag:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description: Tag name (required)
|
||||
color:
|
||||
type: string
|
||||
description: Hex color code (optional, auto-assigned if not
|
||||
provided)
|
||||
required:
|
||||
- name
|
||||
required:
|
||||
- tag
|
||||
required: true
|
||||
"/api/v1/tags/{id}":
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
description: Tag ID
|
||||
schema:
|
||||
type: string
|
||||
get:
|
||||
summary: Retrieve a tag
|
||||
tags:
|
||||
- Tags
|
||||
security:
|
||||
- apiKeyAuth: []
|
||||
responses:
|
||||
'200':
|
||||
description: tag retrieved
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
"$ref": "#/components/schemas/TagDetail"
|
||||
'404':
|
||||
description: tag not found
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
"$ref": "#/components/schemas/ErrorResponse"
|
||||
patch:
|
||||
summary: Update a tag
|
||||
tags:
|
||||
- Tags
|
||||
security:
|
||||
- apiKeyAuth: []
|
||||
parameters: []
|
||||
responses:
|
||||
'200':
|
||||
description: tag updated
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
"$ref": "#/components/schemas/TagDetail"
|
||||
'404':
|
||||
description: tag not found
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
"$ref": "#/components/schemas/ErrorResponse"
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
tag:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
color:
|
||||
type: string
|
||||
required: true
|
||||
delete:
|
||||
summary: Delete a tag
|
||||
tags:
|
||||
- Tags
|
||||
security:
|
||||
- apiKeyAuth: []
|
||||
responses:
|
||||
'204':
|
||||
description: tag deleted
|
||||
'404':
|
||||
description: tag not found
|
||||
"/api/v1/transactions":
|
||||
get:
|
||||
summary: List transactions
|
||||
tags:
|
||||
- Transactions
|
||||
security:
|
||||
- bearerAuth: []
|
||||
- apiKeyAuth: []
|
||||
parameters:
|
||||
- name: Authorization
|
||||
in: header
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: Bearer token with read scope
|
||||
- name: page
|
||||
in: query
|
||||
required: false
|
||||
@@ -1247,14 +1396,8 @@ paths:
|
||||
tags:
|
||||
- Transactions
|
||||
security:
|
||||
- bearerAuth: []
|
||||
parameters:
|
||||
- name: Authorization
|
||||
in: header
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: Bearer token with write scope
|
||||
- apiKeyAuth: []
|
||||
parameters: []
|
||||
responses:
|
||||
'201':
|
||||
description: transaction created
|
||||
@@ -1332,12 +1475,6 @@ paths:
|
||||
required: true
|
||||
"/api/v1/transactions/{id}":
|
||||
parameters:
|
||||
- name: Authorization
|
||||
in: header
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: Bearer token
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
@@ -1349,7 +1486,7 @@ paths:
|
||||
tags:
|
||||
- Transactions
|
||||
security:
|
||||
- bearerAuth: []
|
||||
- apiKeyAuth: []
|
||||
responses:
|
||||
'200':
|
||||
description: transaction retrieved
|
||||
@@ -1368,7 +1505,7 @@ paths:
|
||||
tags:
|
||||
- Transactions
|
||||
security:
|
||||
- bearerAuth: []
|
||||
- apiKeyAuth: []
|
||||
parameters: []
|
||||
responses:
|
||||
'200':
|
||||
@@ -1431,7 +1568,7 @@ paths:
|
||||
tags:
|
||||
- Transactions
|
||||
security:
|
||||
- bearerAuth: []
|
||||
- apiKeyAuth: []
|
||||
responses:
|
||||
'200':
|
||||
description: transaction deleted
|
||||
|
||||
Reference in New Issue
Block a user