From d643020465efe63a12f231fb20fbecac29a3072d Mon Sep 17 00:00:00 2001 From: Rajbir Singh Date: Mon, 7 Oct 2024 15:53:26 +0200 Subject: [PATCH] PMT-16: Add Endpoint Specification --- api/pmt.yml | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 71 insertions(+), 3 deletions(-) diff --git a/api/pmt.yml b/api/pmt.yml index 8c70a51..e8576fa 100644 --- a/api/pmt.yml +++ b/api/pmt.yml @@ -27,9 +27,56 @@ components: type: array items: $ref: "#/components/schemas/ProjectInfo" + CreateProjectDTO: + type: object + properties: + name: + type: string + goal: + type: string + customerId: + type: integer + format: int64 + administratorId: + type: integer + format: int64 + start: + type: string + format: date-time + plannedEnd: + type: string + format: date-time + CreatedProjectDTO: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + goal: + type: string + customerId: + type: integer + format: int64 + administratorId: + type: integer + format: int64 + start: + type: string + format: date-time + plannedEnd: + type: string + format: date-time responses: - UnAuthorized: - description: "Un Authorized" + Unauthorized: + description: "Unauthorized" + NotFound: + description: "Not Found" + content: + text/plain: + schema: + type: string InternalError: description: "Internal Server Error" content: @@ -49,7 +96,28 @@ paths: schema: $ref: "#/components/schemas/GetAllProjectsDTO" 401: - $ref: "#/components/responses/UnAuthorized" + $ref: "#/components/responses/Unauthorized" + 500: + $ref: "#/components/responses/InternalError" + post: + operationId: "CreateProject" + description: "Creates a new Project" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/CreateProjectDTO" + responses: + 201: + description: "Project created successfully" + content: + application/json: + schema: + $ref: "#/components/schemas/CreatedProjectDTO" + 401: + $ref: "#/components/responses/Unauthorized" + 404: + $ref: "#/components/responses/NotFound" 500: $ref: "#/components/responses/InternalError"