-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fec725a
commit 928cc38
Showing
7 changed files
with
189 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
{ | ||
"openapi": "3.0.0", | ||
"info": { | ||
"title": "Users REST API", | ||
"version": "1.0.0", | ||
"description": "A REST API for a simple user management service." | ||
}, | ||
"paths": { | ||
"/users": { | ||
"post": { | ||
"operationId": "createUser", | ||
"summary": "Creates a User", | ||
"requestBody": { | ||
"description": "A user creation request", | ||
"required": true, | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"username": { | ||
"type": "string", | ||
"minLength": 3, | ||
"maxLength": 9 | ||
}, | ||
"password": { | ||
"type": "string", | ||
"minLength": 6, | ||
"maxLength": 12 | ||
} | ||
}, | ||
"required": [ | ||
"username", | ||
"password" | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"201": { | ||
"description": "Created", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/User" | ||
} | ||
} | ||
} | ||
}, | ||
"400": { | ||
"description": "Bad Request", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Error" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/users/{userId}": { | ||
"parameters": [ | ||
{ | ||
"$ref": "#/components/parameters/userId" | ||
} | ||
], | ||
"get": { | ||
"operationId": "getUser", | ||
"summary": "Gets a User", | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/User" | ||
} | ||
} | ||
} | ||
}, | ||
"404": { | ||
"description": "Not Found", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Error" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"delete": { | ||
"operationId": "deleteUser", | ||
"summary": "Deletes a User", | ||
"responses": { | ||
"204": { | ||
"description": "No Content" | ||
}, | ||
"404": { | ||
"description": "Not Found", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Error" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"parameters": { | ||
"userId": { | ||
"name": "userId", | ||
"in": "path", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"schemas": { | ||
"User": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "string" | ||
}, | ||
"username": { | ||
"type": "string", | ||
"minLength": 3, | ||
"maxLength": 9 | ||
}, | ||
"password": { | ||
"type": "string", | ||
"minLength": 6, | ||
"maxLength": 12 | ||
} | ||
} | ||
}, | ||
"Error": { | ||
"type": "object", | ||
"properties": { | ||
"message": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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
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