forked from pglez82/asw2324_0
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added OpenAPI specification for wiq_0 gateway service (#17)
- Included an openapi.yaml file with the v0.2.0 of the specification - Some changes in the gateway.js to create the swagger sever - Added --pull always option to the README
- Loading branch information
1 parent
304dd15
commit 227b3f5
Showing
4 changed files
with
132 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: Gatewayservice API | ||
description: Gateway OpenAPI specification. | ||
version: 0.2.0 | ||
servers: | ||
- url: http://localhost:8000 | ||
description: Development server | ||
- url: http://SOMEIP:8000 | ||
description: Production server | ||
paths: | ||
/adduser: | ||
post: | ||
summary: Add a new user to the database. | ||
operationId: addUser | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
username: | ||
type: string | ||
description: User ID. | ||
password: | ||
type: string | ||
description: User password. | ||
responses: | ||
'200': | ||
description: User added successfully. | ||
'400': | ||
description: Failed to add user. | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
error: | ||
type: string | ||
description: Error information. | ||
/health: | ||
get: | ||
summary: Check the health status of the service. | ||
operationId: checkHealth | ||
responses: | ||
'200': | ||
description: Service is healthy. | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
status: | ||
type: string | ||
description: Health status. | ||
/login: | ||
post: | ||
summary: Log in to the system. | ||
operationId: loginUser | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
username: | ||
type: string | ||
description: User ID. | ||
password: | ||
type: string | ||
description: User password. | ||
responses: | ||
'200': | ||
description: Login successful. Returns user token, username, and creation date. | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
token: | ||
type: string | ||
description: User token. | ||
username: | ||
type: string | ||
description: Username. | ||
createdAt: | ||
type: string | ||
description: Creation date. | ||
'401': | ||
description: Invalid credentials. | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
error: | ||
type: string | ||
description: Invalid Credentials. | ||
'500': | ||
description: Internal server error. | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
error: | ||
type: string | ||
description: Error information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters