{ "openapi": "3.1.1", "info": { "title": "accountingApi | v1", "version": "1.0.0" }, "servers": [ { "url": "https://localhost:7153" }, { "url": "http://localhost:5120" } ], "paths": { "/api/Employee": { "get": { "tags": [ "Employee" ], "responses": { "200": { "description": "OK", "content": { "text/plain": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Employee" } } }, "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Employee" } } }, "text/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Employee" } } } } } } }, "post": { "tags": [ "Employee" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Employee" } }, "text/json": { "schema": { "$ref": "#/components/schemas/Employee" } }, "application/*+json": { "schema": { "$ref": "#/components/schemas/Employee" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/Employee" } }, "application/json": { "schema": { "$ref": "#/components/schemas/Employee" } }, "text/json": { "schema": { "$ref": "#/components/schemas/Employee" } } } } } } }, "/api/Employee/{id}": { "get": { "tags": [ "Employee" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" } } ], "responses": { "200": { "description": "OK", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/Employee" } }, "application/json": { "schema": { "$ref": "#/components/schemas/Employee" } }, "text/json": { "schema": { "$ref": "#/components/schemas/Employee" } } } } } }, "put": { "tags": [ "Employee" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Employee" } }, "text/json": { "schema": { "$ref": "#/components/schemas/Employee" } }, "application/*+json": { "schema": { "$ref": "#/components/schemas/Employee" } } }, "required": true }, "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "Employee" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" } } ], "responses": { "200": { "description": "OK" } } } }, "/api/Voucher": { "get": { "tags": [ "Voucher" ], "responses": { "200": { "description": "OK", "content": { "text/plain": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/VoucherDto" } } }, "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/VoucherDto" } } }, "text/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/VoucherDto" } } } } } } }, "post": { "tags": [ "Voucher" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Voucher" } }, "text/json": { "schema": { "$ref": "#/components/schemas/Voucher" } }, "application/*+json": { "schema": { "$ref": "#/components/schemas/Voucher" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/VoucherDto" } }, "application/json": { "schema": { "$ref": "#/components/schemas/VoucherDto" } }, "text/json": { "schema": { "$ref": "#/components/schemas/VoucherDto" } } } } } } }, "/api/Voucher/employee/{employeeId}": { "get": { "tags": [ "Voucher" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" } } ], "responses": { "200": { "description": "OK", "content": { "text/plain": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/VoucherDto" } } }, "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/VoucherDto" } } }, "text/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/VoucherDto" } } } } } } } }, "/api/Voucher/{id}": { "get": { "tags": [ "Voucher" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" } } ], "responses": { "200": { "description": "OK", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/VoucherDto" } }, "application/json": { "schema": { "$ref": "#/components/schemas/VoucherDto" } }, "text/json": { "schema": { "$ref": "#/components/schemas/VoucherDto" } } } } } }, "delete": { "tags": [ "Voucher" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" } } ], "responses": { "200": { "description": "OK" } } }, "put": { "tags": [ "Voucher" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Voucher" } }, "text/json": { "schema": { "$ref": "#/components/schemas/Voucher" } }, "application/*+json": { "schema": { "$ref": "#/components/schemas/Voucher" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/VoucherDto" } }, "application/json": { "schema": { "$ref": "#/components/schemas/VoucherDto" } }, "text/json": { "schema": { "$ref": "#/components/schemas/VoucherDto" } } } } } } }, "/WeatherForecast": { "get": { "tags": [ "WeatherForecast" ], "operationId": "GetWeatherForecast", "responses": { "200": { "description": "OK", "content": { "text/plain": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/WeatherForecast" } } }, "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/WeatherForecast" } } }, "text/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/WeatherForecast" } } } } } } } } }, "components": { "schemas": { "Employee": { "required": [ "firstName", "lastName" ], "type": "object", "properties": { "id": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" }, "firstName": { "type": "string" }, "lastName": { "type": "string" }, "email": { "type": "string" }, "phone": { "type": "string" }, "hireDate": { "type": "string", "format": "date-time" }, "salary": { "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$", "type": [ "number", "string" ], "format": "double" }, "vouchers": { "type": [ "null", "array" ], "items": { "$ref": "#/components/schemas/Voucher" } } } }, "Voucher": { "required": [ "voucherNumber" ], "type": "object", "properties": { "id": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" }, "voucherNumber": { "type": "string" }, "date": { "type": "string", "format": "date-time" }, "description": { "type": "string" }, "employeeId": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" }, "totalAmount": { "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$", "type": [ "number", "string" ], "format": "double" }, "employee": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/Employee" } ] }, "voucherItems": { "type": [ "null", "array" ], "items": { "$ref": "#/components/schemas/VoucherItem" } } } }, "VoucherDto": { "type": "object", "properties": { "id": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" }, "voucherNumber": { "type": "string" }, "date": { "type": "string", "format": "date-time" }, "description": { "type": "string" }, "totalAmount": { "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$", "type": [ "number", "string" ], "format": "double" }, "employeeName": { "type": "string" }, "voucherItems": { "type": "array", "items": { "$ref": "#/components/schemas/VoucherItemDto" } } } }, "VoucherItem": { "required": [ "description", "type" ], "type": "object", "properties": { "id": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" }, "voucherId": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" }, "description": { "type": "string" }, "amount": { "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$", "type": [ "number", "string" ], "format": "double" }, "type": { "$ref": "#/components/schemas/VoucherType" }, "voucher": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/Voucher" } ] } } }, "VoucherItemDto": { "type": "object", "properties": { "id": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" }, "description": { "type": "string" }, "amount": { "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$", "type": [ "number", "string" ], "format": "double" }, "type": { "type": "string" } } }, "VoucherType": { "type": "integer" }, "WeatherForecast": { "type": "object", "properties": { "date": { "type": "string", "format": "date" }, "temperatureC": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" }, "temperatureF": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" }, "summary": { "type": [ "null", "string" ] } } } } }, "tags": [ { "name": "Employee" }, { "name": "Voucher" }, { "name": "WeatherForecast" } ] }