From 17c8e508f9e67ced438f4c8cbbcdf81fc71b9dab Mon Sep 17 00:00:00 2001 From: Shubha Rajan Date: Tue, 28 Jun 2022 16:54:43 -0700 Subject: [PATCH] chore: fix paths in openapi spec to get build working --- api/openapi_server/_spec/openapi.yaml | 233 +++++++++++++++++- api/openapi_server/openapi/openapi.yaml | 19 +- .../openapi/paths/auth/authConfirm.yaml | 2 +- .../paths/auth/authConfirmForgotPassword.yaml | 2 +- .../paths/auth/authForgotPassword.yaml | 2 +- .../openapi/paths/auth/authPrivate.yaml | 2 +- .../openapi/paths/auth/authRefresh.yaml | 2 +- .../openapi/paths/auth/authSession.yaml | 2 +- .../openapi/paths/auth/authSignin.yaml | 2 +- .../openapi/paths/auth/authSignout.yaml | 2 +- .../openapi/paths/auth/authSignup.yaml | 2 +- .../openapi/paths/auth/authToken.yaml | 2 +- .../openapi/paths/auth/authUser.yaml | 2 +- 13 files changed, 253 insertions(+), 21 deletions(-) diff --git a/api/openapi_server/_spec/openapi.yaml b/api/openapi_server/_spec/openapi.yaml index 33e61e4b..23cc85d7 100644 --- a/api/openapi_server/_spec/openapi.yaml +++ b/api/openapi_server/_spec/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: license: - name: MIT + name: GPL 2.0 title: Home Unite Us version: 1.0.0 servers: @@ -115,7 +115,238 @@ paths: default: $ref: '#/components/responses/UnexpectedError' x-openapi-router-controller: openapi_server.controllers.service_provider_controller + /auth/signup: + post: + description: Signup a user + operationId: signup + requestBody: + content: + application/json: + schema: + type: object + properties: + email: + type: string + password: + type: string + required: + - email + - password + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + tags: + - auth + x-openapi-router-controller: openapi_server.controllers.auth_controller + /auth/signin: + post: + description: Sign in a user + operationId: signin + requestBody: + content: + application/json: + schema: + type: object + properties: + email: + type: string + password: + type: string + required: + - email + - password + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + tags: + - auth + x-openapi-router-controller: openapi_server.controllers.auth_controller + /auth/confirm: + post: + description: Confirm users email + operationId: confirm + requestBody: + content: + application/json: + schema: + type: object + properties: + email: + type: string + code: + type: string + required: + - email + - code + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + tags: + - auth + x-openapi-router-controller: openapi_server.controllers.auth_controller + /auth/signout: + post: + description: Sign out user from current session + operationId: signout + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + tags: + - auth + x-openapi-router-controller: openapi_server.controllers.auth_controller + /auth/token: + post: + description: Sign in user from OAuth Provider + operationId: token + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + tags: + - auth + x-openapi-router-controller: openapi_server.controllers.auth_controller + /auth/session: + get: + description: Get current session and user information + operationId: current_session + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + tags: + - auth + x-openapi-router-controller: openapi_server.controllers.auth_controller + /auth/refresh: + get: + description: Check for refresh token and current session + operationId: refresh + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + tags: + - auth + x-openapi-router-controller: openapi_server.controllers.auth_controller + /auth/forgot_password: + post: + description: Sends message with a code used when creating a new password + operationId: forgot_password + requestBody: + content: + application/json: + schema: + type: object + properties: + email: + type: string + required: + - email + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + tags: + - auth + x-openapi-router-controller: openapi_server.controllers.auth_controller + /auth/confirm_forgot_password: + post: + description: Exchanges code for a new password + operationId: confirm_forgot_password + requestBody: + content: + application/json: + schema: + type: object + properties: + email: + type: string + code: + type: string + password: + type: string + required: + - email + - code + - password + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + tags: + - auth + x-openapi-router-controller: openapi_server.controllers.auth_controller + /auth/user: + get: + description: Gets current user + operationId: user + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + tags: + - auth + x-openapi-router-controller: openapi_server.controllers.auth_controller + security: + - jwt: + - secret + /auth/private: + get: + description: A private route that returns a message + operationId: private + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + tags: + - auth + x-openapi-router-controller: openapi_server.controllers.auth_controller + security: + - jwt: + - secret components: + securitySchemes: + jwt: + type: http + scheme: bearer + bearerFormat: JWT + x-bearerInfoFunc: openapi_server.controllers.security_controller.requires_auth responses: UnexpectedError: description: Unexpected Error diff --git a/api/openapi_server/openapi/openapi.yaml b/api/openapi_server/openapi/openapi.yaml index 67f87511..a26150f7 100644 --- a/api/openapi_server/openapi/openapi.yaml +++ b/api/openapi_server/openapi/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: license: - name: MIT + name: GPL 2.0 title: Home Unite Us version: 1.0.0 servers: @@ -30,10 +30,16 @@ paths: /auth/confirm_forgot_password: $ref: './paths/auth/authConfirmForgotPassword.yaml' /auth/user: - $ref: './paths/auth/authUser.yaml' + $ref: './paths/auth/authUser.yaml' /auth/private: - $ref: './paths/auth/authPrivate.yaml' + $ref: './paths/auth/authPrivate.yaml' components: + securitySchemes: + jwt: + type: http + scheme: bearer + bearerFormat: JWT + x-bearerInfoFunc: openapi_server.controllers.security_controller.requires_auth responses: $ref: './responses/_index.yaml' parameters: @@ -58,9 +64,4 @@ components: type: string title: ApiResponse type: object - securitySchemes: - jwt: - type: http - scheme: bearer - bearerFormat: JWT - x-bearerInfoFunc: openapi_server.controllers.security_controller.requires_auth + diff --git a/api/openapi_server/openapi/paths/auth/authConfirm.yaml b/api/openapi_server/openapi/paths/auth/authConfirm.yaml index c42de381..1297ca3c 100644 --- a/api/openapi_server/openapi/paths/auth/authConfirm.yaml +++ b/api/openapi_server/openapi/paths/auth/authConfirm.yaml @@ -19,7 +19,7 @@ post: content: application/json: schema: - $ref: "#/components/schemas/ApiResponse" + $ref: "../../openapi.yaml#/components/schemas/ApiResponse" description: successful operation tags: - auth diff --git a/api/openapi_server/openapi/paths/auth/authConfirmForgotPassword.yaml b/api/openapi_server/openapi/paths/auth/authConfirmForgotPassword.yaml index b175455b..4b89eb12 100644 --- a/api/openapi_server/openapi/paths/auth/authConfirmForgotPassword.yaml +++ b/api/openapi_server/openapi/paths/auth/authConfirmForgotPassword.yaml @@ -22,7 +22,7 @@ post: content: application/json: schema: - $ref: "#/components/schemas/ApiResponse" + $ref: "../../openapi.yaml#/components/schemas/ApiResponse" description: successful operation tags: - auth diff --git a/api/openapi_server/openapi/paths/auth/authForgotPassword.yaml b/api/openapi_server/openapi/paths/auth/authForgotPassword.yaml index 4a5b0a5d..743d98bc 100644 --- a/api/openapi_server/openapi/paths/auth/authForgotPassword.yaml +++ b/api/openapi_server/openapi/paths/auth/authForgotPassword.yaml @@ -16,7 +16,7 @@ post: content: application/json: schema: - $ref: "#/components/schemas/ApiResponse" + $ref: "../../openapi.yaml#/components/schemas/ApiResponse" description: successful operation tags: - auth diff --git a/api/openapi_server/openapi/paths/auth/authPrivate.yaml b/api/openapi_server/openapi/paths/auth/authPrivate.yaml index 19de2773..7e0bf8e2 100644 --- a/api/openapi_server/openapi/paths/auth/authPrivate.yaml +++ b/api/openapi_server/openapi/paths/auth/authPrivate.yaml @@ -6,7 +6,7 @@ get: content: application/json: schema: - $ref: "#/components/schemas/ApiResponse" + $ref: "../../openapi.yaml#/components/schemas/ApiResponse" description: successful operation tags: - auth diff --git a/api/openapi_server/openapi/paths/auth/authRefresh.yaml b/api/openapi_server/openapi/paths/auth/authRefresh.yaml index 1f578e7b..c00fee58 100644 --- a/api/openapi_server/openapi/paths/auth/authRefresh.yaml +++ b/api/openapi_server/openapi/paths/auth/authRefresh.yaml @@ -6,7 +6,7 @@ get: content: application/json: schema: - $ref: "#/components/schemas/ApiResponse" + $ref: "../../openapi.yaml#/components/schemas/ApiResponse" description: successful operation tags: - auth diff --git a/api/openapi_server/openapi/paths/auth/authSession.yaml b/api/openapi_server/openapi/paths/auth/authSession.yaml index 7b60c115..e9f53098 100644 --- a/api/openapi_server/openapi/paths/auth/authSession.yaml +++ b/api/openapi_server/openapi/paths/auth/authSession.yaml @@ -6,7 +6,7 @@ get: content: application/json: schema: - $ref: "#/components/schemas/ApiResponse" + $ref: "../../openapi.yaml#/components/schemas/ApiResponse" description: successful operation tags: - auth diff --git a/api/openapi_server/openapi/paths/auth/authSignin.yaml b/api/openapi_server/openapi/paths/auth/authSignin.yaml index 37213c2d..dae313a0 100644 --- a/api/openapi_server/openapi/paths/auth/authSignin.yaml +++ b/api/openapi_server/openapi/paths/auth/authSignin.yaml @@ -19,7 +19,7 @@ post: content: application/json: schema: - $ref: "#/components/schemas/ApiResponse" + $ref: "../../openapi.yaml#/components/schemas/ApiResponse" description: successful operation tags: - auth diff --git a/api/openapi_server/openapi/paths/auth/authSignout.yaml b/api/openapi_server/openapi/paths/auth/authSignout.yaml index 0fdba9f8..a1a813dd 100644 --- a/api/openapi_server/openapi/paths/auth/authSignout.yaml +++ b/api/openapi_server/openapi/paths/auth/authSignout.yaml @@ -6,7 +6,7 @@ post: content: application/json: schema: - $ref: "#/components/schemas/ApiResponse" + $ref: "../../openapi.yaml#/components/schemas/ApiResponse" description: successful operation tags: - auth diff --git a/api/openapi_server/openapi/paths/auth/authSignup.yaml b/api/openapi_server/openapi/paths/auth/authSignup.yaml index fc7b09a1..eac28bbf 100644 --- a/api/openapi_server/openapi/paths/auth/authSignup.yaml +++ b/api/openapi_server/openapi/paths/auth/authSignup.yaml @@ -19,7 +19,7 @@ post: content: application/json: schema: - $ref: "#/components/schemas/ApiResponse" + $ref: "../../openapi.yaml#/components/schemas/ApiResponse" description: successful operation tags: - auth diff --git a/api/openapi_server/openapi/paths/auth/authToken.yaml b/api/openapi_server/openapi/paths/auth/authToken.yaml index 1f8896c8..f9ab6e61 100644 --- a/api/openapi_server/openapi/paths/auth/authToken.yaml +++ b/api/openapi_server/openapi/paths/auth/authToken.yaml @@ -6,7 +6,7 @@ post: content: application/json: schema: - $ref: "#/components/schemas/ApiResponse" + $ref: "../../openapi.yaml#/components/schemas/ApiResponse" description: successful operation tags: - auth diff --git a/api/openapi_server/openapi/paths/auth/authUser.yaml b/api/openapi_server/openapi/paths/auth/authUser.yaml index 466c7eee..7dcb07fe 100644 --- a/api/openapi_server/openapi/paths/auth/authUser.yaml +++ b/api/openapi_server/openapi/paths/auth/authUser.yaml @@ -6,7 +6,7 @@ get: content: application/json: schema: - $ref: "#/components/schemas/ApiResponse" + $ref: "../../openapi.yaml#/components/schemas/ApiResponse" description: successful operation tags: - auth