Skip to content

Commit

Permalink
chore: fix paths in openapi spec to get build working
Browse files Browse the repository at this point in the history
  • Loading branch information
shubha-rajan committed Jun 28, 2022
1 parent ae1aa3f commit 17c8e50
Show file tree
Hide file tree
Showing 13 changed files with 253 additions and 21 deletions.
233 changes: 232 additions & 1 deletion api/openapi_server/_spec/openapi.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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
Expand Down
19 changes: 10 additions & 9 deletions api/openapi_server/openapi/openapi.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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

2 changes: 1 addition & 1 deletion api/openapi_server/openapi/paths/auth/authConfirm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ post:
content:
application/json:
schema:
$ref: "#/components/schemas/ApiResponse"
$ref: "../../openapi.yaml#/components/schemas/ApiResponse"
description: successful operation
tags:
- auth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ post:
content:
application/json:
schema:
$ref: "#/components/schemas/ApiResponse"
$ref: "../../openapi.yaml#/components/schemas/ApiResponse"
description: successful operation
tags:
- auth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ post:
content:
application/json:
schema:
$ref: "#/components/schemas/ApiResponse"
$ref: "../../openapi.yaml#/components/schemas/ApiResponse"
description: successful operation
tags:
- auth
Expand Down
2 changes: 1 addition & 1 deletion api/openapi_server/openapi/paths/auth/authPrivate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ get:
content:
application/json:
schema:
$ref: "#/components/schemas/ApiResponse"
$ref: "../../openapi.yaml#/components/schemas/ApiResponse"
description: successful operation
tags:
- auth
Expand Down
2 changes: 1 addition & 1 deletion api/openapi_server/openapi/paths/auth/authRefresh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ get:
content:
application/json:
schema:
$ref: "#/components/schemas/ApiResponse"
$ref: "../../openapi.yaml#/components/schemas/ApiResponse"
description: successful operation
tags:
- auth
Expand Down
2 changes: 1 addition & 1 deletion api/openapi_server/openapi/paths/auth/authSession.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ get:
content:
application/json:
schema:
$ref: "#/components/schemas/ApiResponse"
$ref: "../../openapi.yaml#/components/schemas/ApiResponse"
description: successful operation
tags:
- auth
Expand Down
2 changes: 1 addition & 1 deletion api/openapi_server/openapi/paths/auth/authSignin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ post:
content:
application/json:
schema:
$ref: "#/components/schemas/ApiResponse"
$ref: "../../openapi.yaml#/components/schemas/ApiResponse"
description: successful operation
tags:
- auth
Expand Down
2 changes: 1 addition & 1 deletion api/openapi_server/openapi/paths/auth/authSignout.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ post:
content:
application/json:
schema:
$ref: "#/components/schemas/ApiResponse"
$ref: "../../openapi.yaml#/components/schemas/ApiResponse"
description: successful operation
tags:
- auth
Expand Down
2 changes: 1 addition & 1 deletion api/openapi_server/openapi/paths/auth/authSignup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ post:
content:
application/json:
schema:
$ref: "#/components/schemas/ApiResponse"
$ref: "../../openapi.yaml#/components/schemas/ApiResponse"
description: successful operation
tags:
- auth
Expand Down
2 changes: 1 addition & 1 deletion api/openapi_server/openapi/paths/auth/authToken.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ post:
content:
application/json:
schema:
$ref: "#/components/schemas/ApiResponse"
$ref: "../../openapi.yaml#/components/schemas/ApiResponse"
description: successful operation
tags:
- auth
Expand Down
2 changes: 1 addition & 1 deletion api/openapi_server/openapi/paths/auth/authUser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ get:
content:
application/json:
schema:
$ref: "#/components/schemas/ApiResponse"
$ref: "../../openapi.yaml#/components/schemas/ApiResponse"
description: successful operation
tags:
- auth
Expand Down

0 comments on commit 17c8e50

Please sign in to comment.