feat: add NSwag config and commit generated openapi.json

This commit is contained in:
Martin 2026-03-20 00:59:08 +01:00
parent 1062739832
commit 4a4c9515f6
2 changed files with 381 additions and 0 deletions

View File

@ -0,0 +1,15 @@
{
"runtime": "Net80",
"documentGenerator": {
"aspNetCoreToOpenApi": {
"project": "AccountTracking.Api.csproj",
"msBuildProjectExtensionsPath": null,
"configuration": "Debug",
"noBuild": true,
"verbose": false,
"outputType": "OpenApi3",
"output": "openapi.json"
}
},
"codeGenerators": {}
}

View File

@ -0,0 +1,366 @@
{
"x-generator": "NSwag v14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))",
"openapi": "3.0.0",
"info": {
"title": "AccountTracking API",
"version": "v1"
},
"servers": [
{
"url": "http://localhost:5099"
}
],
"paths": {
"/api/auth/login": {
"post": {
"tags": [
"Auth"
],
"operationId": "Auth_Login",
"requestBody": {
"x-name": "request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/LoginRequest"
}
}
},
"required": true,
"x-position": 1
},
"responses": {
"200": {
"description": "",
"content": {
"application/octet-stream": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
}
}
}
},
"/api/dashboard/summary": {
"get": {
"tags": [
"Dashboard"
],
"operationId": "Dashboard_Summary",
"parameters": [
{
"name": "year",
"in": "query",
"schema": {
"type": "integer",
"format": "int32"
},
"x-position": 1
},
{
"name": "month",
"in": "query",
"schema": {
"type": "integer",
"format": "int32",
"nullable": true
},
"x-position": 2
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/octet-stream": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
}
}
}
},
"/api/dashboard/spending-by-category": {
"get": {
"tags": [
"Dashboard"
],
"operationId": "Dashboard_SpendingByCategory",
"parameters": [
{
"name": "year",
"in": "query",
"schema": {
"type": "integer",
"format": "int32"
},
"x-position": 1
},
{
"name": "month",
"in": "query",
"schema": {
"type": "integer",
"format": "int32",
"nullable": true
},
"x-position": 2
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/octet-stream": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
}
}
}
},
"/api/dashboard/monthly-balances": {
"get": {
"tags": [
"Dashboard"
],
"operationId": "Dashboard_MonthlyBalances",
"parameters": [
{
"name": "year",
"in": "query",
"schema": {
"type": "integer",
"format": "int32"
},
"x-position": 1
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/octet-stream": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
}
}
}
},
"/api/dashboard/cumulative-spending": {
"get": {
"tags": [
"Dashboard"
],
"operationId": "Dashboard_CumulativeSpending",
"parameters": [
{
"name": "year",
"in": "query",
"schema": {
"type": "integer",
"format": "int32"
},
"x-position": 1
},
{
"name": "month",
"in": "query",
"schema": {
"type": "integer",
"format": "int32"
},
"x-position": 2
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/octet-stream": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
}
}
}
},
"/api/transactions/import": {
"post": {
"tags": [
"Transactions"
],
"operationId": "Transactions_Import",
"requestBody": {
"content": {
"multipart/form-data": {
"schema": {
"type": "object",
"properties": {
"file": {
"type": "string",
"format": "binary",
"nullable": true
}
}
}
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/octet-stream": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
}
}
}
},
"/api/transactions": {
"get": {
"tags": [
"Transactions"
],
"operationId": "Transactions_List",
"parameters": [
{
"name": "year",
"in": "query",
"schema": {
"type": "integer",
"format": "int32"
},
"x-position": 1
},
{
"name": "month",
"in": "query",
"schema": {
"type": "integer",
"format": "int32",
"nullable": true
},
"x-position": 2
},
{
"name": "category",
"in": "query",
"schema": {
"type": "string",
"nullable": true
},
"x-position": 3
},
{
"name": "search",
"in": "query",
"schema": {
"type": "string",
"nullable": true
},
"x-position": 4
},
{
"name": "page",
"in": "query",
"schema": {
"type": "integer",
"format": "int32",
"default": 1
},
"x-position": 5
},
{
"name": "pageSize",
"in": "query",
"schema": {
"type": "integer",
"format": "int32",
"default": 50
},
"x-position": 6
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/octet-stream": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
}
}
}
},
"/api/transactions/categories": {
"get": {
"tags": [
"Transactions"
],
"operationId": "Transactions_Categories",
"responses": {
"200": {
"description": "",
"content": {
"application/octet-stream": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"LoginRequest": {
"type": "object",
"additionalProperties": false,
"properties": {
"username": {
"type": "string"
},
"password": {
"type": "string"
}
}
}
},
"securitySchemes": {
"Bearer": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT"
}
}
}
}