Skip to content

Commit

Permalink
feat: add documentation for get user by id endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
JpBurgarelli committed May 1, 2024
1 parent 3b424a9 commit 9e22480
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
41 changes: 41 additions & 0 deletions openapi/features/user/get-user-by-id.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
get:
operationId: getUserById
summary: Get a user by id
description: This endpoint allows you to get a user by id.
tags:
- user

parameters:
- in: path
name: id
required: true
schema:
type: string
description: The user ID.

responses:
'200':
description: Successful operation
content:
application/json:
schema:
type: object
properties:
id:
type: string
example: '1'
name:
type: string
example: 'John Doe'
username:
type: string
example: 'johndoe123'
email:
type: string
example: 'johndoe@example.com'
'400':
$ref: '../../shared/errors/validation-error.yaml'
'404':
description: User not found
'500':
$ref: '../../shared/errors/server-error.yaml'
3 changes: 3 additions & 0 deletions openapi/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ tags:
paths:
/api/users:
$ref: './features/user/user-create-path.yaml'
/api/users/{id}:
$ref: './features/user/get-user-by-id.yaml'

0 comments on commit 9e22480

Please sign in to comment.