From 1fa28fb2e1ded148d58508caa586123d50a01c5e Mon Sep 17 00:00:00 2001 From: William Brawner Date: Sat, 18 Feb 2023 22:51:42 -0700 Subject: [PATCH] Generate OpenAPI Spec This still needs a lot of love but the generated spec is a good start Signed-off-by: William Brawner --- .../main/resources/openapi/documentation.yaml | 597 ++++++++++++++++++ 1 file changed, 597 insertions(+) create mode 100644 app/src/main/resources/openapi/documentation.yaml diff --git a/app/src/main/resources/openapi/documentation.yaml b/app/src/main/resources/openapi/documentation.yaml new file mode 100644 index 0000000..8205d2c --- /dev/null +++ b/app/src/main/resources/openapi/documentation.yaml @@ -0,0 +1,597 @@ +openapi: "3.0.3" +info: + title: "twigs API" + description: "twigs API" + version: "1.0.0" +servers: + - url: "https://twigs" +paths: + /api/recurringtransactions: + get: + description: "" + parameters: + - name: "budgetId" + in: "query" + required: false + schema: + type: "string" + responses: + "200": + description: "OK" + content: + '*/*': + schema: + type: "array" + items: + $ref: "#/components/schemas/RecurringTransactionResponse" + post: + description: "" + responses: + "200": + description: "OK" + content: + '*/*': + schema: + $ref: "#/components/schemas/RecurringTransactionResponse" + /api/recurringtransactions/{id}: + delete: + description: "" + parameters: + - name: "id" + in: "path" + required: true + schema: + type: "string" + responses: + "204": + description: "No Content" + content: + '*/*': + schema: + type: "object" + "500": + description: "Internal Server Error" + content: + '*/*': + schema: + type: "object" + get: + description: "" + parameters: + - name: "id" + in: "path" + required: true + schema: + type: "string" + responses: + "200": + description: "OK" + content: + '*/*': + schema: + $ref: "#/components/schemas/RecurringTransactionResponse" + put: + description: "" + parameters: + - name: "id" + in: "path" + required: true + schema: + type: "string" + responses: + "200": + description: "OK" + content: + '*/*': + schema: + $ref: "#/components/schemas/RecurringTransactionResponse" + /api/categories: + get: + description: "" + parameters: + - name: "budgetIds" + in: "query" + required: false + schema: + type: "string" + - name: "expense" + in: "query" + required: false + schema: + type: "string" + - name: "archived" + in: "query" + required: false + schema: + type: "string" + responses: + "200": + description: "OK" + content: + '*/*': + schema: + type: "array" + items: + type: "object" + post: + description: "" + responses: + "200": + description: "OK" + content: + '*/*': + schema: + $ref: "#/components/schemas/CategoryResponse" + /api/categories/{id}: + delete: + description: "" + parameters: + - name: "id" + in: "path" + required: true + schema: + type: "string" + responses: + "204": + description: "No Content" + content: + '*/*': + schema: + type: "object" + get: + description: "" + parameters: + - name: "id" + in: "path" + required: true + schema: + type: "string" + responses: + "200": + description: "OK" + content: + '*/*': + schema: + $ref: "#/components/schemas/CategoryResponse" + put: + description: "" + parameters: + - name: "id" + in: "path" + required: true + schema: + type: "string" + responses: + "404": + description: "Not Found" + content: + '*/*': + schema: + type: "object" + "200": + description: "OK" + content: + '*/*': + schema: + $ref: "#/components/schemas/CategoryResponse" + /api/passwordreset: + post: + description: "" + responses: + "204": + description: "No Content" + content: + '*/*': + schema: + type: "object" + /api/resetpassword: + post: + description: "" + responses: + "202": + description: "Accepted" + content: + '*/*': + schema: + type: "object" + /api/users: + get: + description: "" + parameters: + - name: "query" + in: "query" + required: false + schema: + type: "string" + - name: "budgetId" + in: "query" + required: false + schema: + type: "string" + responses: + "200": + description: "OK" + content: + '*/*': + schema: + type: "array" + items: + type: "object" + post: + description: "" + responses: + "200": + description: "OK" + content: + '*/*': + schema: + $ref: "#/components/schemas/UserResponse" + /api/users/{id}: + delete: + description: "" + parameters: + - name: "id" + in: "path" + required: true + schema: + type: "string" + responses: + "204": + description: "No Content" + content: + '*/*': + schema: + type: "object" + get: + description: "" + parameters: + - name: "id" + in: "path" + required: true + schema: + type: "string" + responses: + "200": + description: "OK" + content: + '*/*': + schema: + $ref: "#/components/schemas/UserResponse" + put: + description: "" + parameters: + - name: "id" + in: "path" + required: true + schema: + type: "string" + - name: "id" + in: "path" + required: true + schema: + type: "string" + responses: + "200": + description: "OK" + content: + '*/*': + schema: + $ref: "#/components/schemas/UserResponse" + /api/users/login: + post: + description: "" + responses: + "200": + description: "OK" + content: + '*/*': + schema: + $ref: "#/components/schemas/SessionResponse" + /api/users/register: + post: + description: "" + responses: + "200": + description: "OK" + content: + '*/*': + schema: + $ref: "#/components/schemas/UserResponse" + /api/budgets: + get: + description: "" + responses: + "200": + description: "OK" + content: + '*/*': + schema: + type: "array" + items: + type: "object" + post: + description: "" + responses: + "200": + description: "OK" + content: + '*/*': + schema: + $ref: "#/components/schemas/BudgetResponse" + /api/budgets/{id}: + delete: + description: "" + parameters: + - name: "id" + in: "path" + required: true + schema: + type: "string" + responses: + "204": + description: "No Content" + content: + '*/*': + schema: + type: "object" + get: + description: "" + parameters: + - name: "id" + in: "path" + required: true + schema: + type: "string" + responses: + "200": + description: "OK" + content: + '*/*': + schema: + $ref: "#/components/schemas/BudgetResponse" + put: + description: "" + parameters: + - name: "id" + in: "path" + required: true + schema: + type: "string" + responses: + "200": + description: "OK" + content: + '*/*': + schema: + $ref: "#/components/schemas/BudgetResponse" + /api/transactions: + get: + description: "" + parameters: + - name: "budgetIds" + in: "query" + required: false + schema: + type: "string" + - name: "categoryIds" + in: "query" + required: false + schema: + type: "string" + - name: "from" + in: "query" + required: false + schema: + type: "string" + - name: "to" + in: "query" + required: false + schema: + type: "string" + - name: "expense" + in: "query" + required: false + schema: + type: "string" + responses: + "200": + description: "OK" + content: + '*/*': + schema: + type: "array" + items: + $ref: "#/components/schemas/TransactionResponse" + post: + description: "" + responses: + "200": + description: "OK" + content: + '*/*': + schema: + $ref: "#/components/schemas/TransactionResponse" + /api/transactions/{id}: + delete: + description: "" + parameters: + - name: "id" + in: "path" + required: true + schema: + type: "string" + responses: + "204": + description: "No Content" + content: + '*/*': + schema: + type: "object" + "500": + description: "Internal Server Error" + content: + '*/*': + schema: + type: "object" + get: + description: "" + parameters: + - name: "id" + in: "path" + required: true + schema: + type: "string" + responses: + "200": + description: "OK" + content: + '*/*': + schema: + $ref: "#/components/schemas/TransactionResponse" + put: + description: "" + parameters: + - name: "id" + in: "path" + required: true + schema: + type: "string" + responses: + "200": + description: "OK" + content: + '*/*': + schema: + $ref: "#/components/schemas/TransactionResponse" + /api/transactions/sum: + get: + description: "" + parameters: + - name: "categoryId" + in: "query" + required: false + schema: + type: "string" + - name: "budgetId" + in: "query" + required: false + schema: + type: "string" + - name: "from" + in: "query" + required: false + schema: + type: "string" + - name: "to" + in: "query" + required: false + schema: + type: "string" + responses: + "200": + description: "OK" + content: + '*/*': + schema: + $ref: "#/components/schemas/BalanceResponse" +components: + schemas: + RecurringTransactionResponse: + type: "object" + properties: + id: + type: "string" + title: + type: "string" + description: + type: "string" + frequency: + type: "string" + start: + type: "string" + finish: + type: "string" + amount: + type: "integer" + format: "int64" + expense: + type: "boolean" + budgetId: + type: "string" + categoryId: + type: "string" + createdBy: + type: "string" + CategoryResponse: + type: "object" + properties: + id: + type: "string" + title: + type: "string" + description: + type: "string" + amount: + type: "integer" + format: "int64" + budgetId: + type: "string" + expense: + type: "boolean" + archived: + type: "boolean" + UserResponse: + type: "object" + properties: + id: + type: "string" + username: + type: "string" + email: + type: "string" + SessionResponse: + type: "object" + properties: + userId: + type: "string" + token: + type: "string" + expiration: + type: "string" + BudgetResponse: + type: "object" + properties: + id: + type: "string" + name: + type: "string" + description: + type: "string" + TransactionResponse: + type: "object" + properties: + id: + type: "string" + title: + type: "string" + description: + type: "string" + date: + type: "string" + amount: + type: "integer" + format: "int64" + expense: + type: "boolean" + budgetId: + type: "string" + categoryId: + type: "string" + createdBy: + type: "string" + BalanceResponse: + type: "object" + properties: + balance: + type: "integer" + format: "int64" \ No newline at end of file