Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 57 additions & 10 deletions docs/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/User'
$ref: '#/components/schemas/UserInput'
responses:
'201':
description: User created
Expand All @@ -331,6 +331,12 @@ paths:
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
'409':
description: Email already exists
content:
application/json:
schema:
$ref: '#/components/schemas/Error'

/users/{id}:
get:
Expand All @@ -349,7 +355,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/User'
$ref: '#/components/schemas/UserResponse'
'404':
description: User not found
content:
Expand All @@ -371,14 +377,14 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/User'
$ref: '#/components/schemas/UserInput'
responses:
'200':
description: User updated
content:
application/json:
schema:
$ref: '#/components/schemas/User'
$ref: '#/components/schemas/UserResponse'
'400':
description: Invalid input data
content:
Expand Down Expand Up @@ -460,9 +466,7 @@ paths:
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Sneaker'
$ref: '#/components/schemas/FavoritesResponse'
'404':
description: User or sneaker not found
content:
Expand Down Expand Up @@ -798,6 +802,16 @@ components:
type: string
required: [rating]

UserInput:
type: object
properties:
name:
type: string
email:
type: string
format: email
required: [name, email]

User:
type: object
properties:
Expand All @@ -809,8 +823,38 @@ components:
email:
type: string
format: email
favorites:
type: array
items:
type: string
required: [name, email]

UserResponse:
type: object
properties:
items:
$ref: '#/components/schemas/User'
message:
type: string
status:
type: string
enum: [success]
required: [items, message, status]

FavoritesResponse:
type: object
properties:
items:
type: array
items:
type: string
message:
type: string
status:
type: string
enum: [success]
required: [items, message, status]

Provider:
type: object
properties:
Expand Down Expand Up @@ -840,6 +884,9 @@ components:
Error:
type: object
properties:
code: { type: string }
message: { type: string }
required: [error]
message:
type: string
status:
type: string
enum: [failure]
required: [message, status]
43 changes: 22 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@
"license": "ISC",
"description": "",
"devDependencies": {
"@types/express": "5.0.0",
"@types/express": "^5.0.0",
"@types/mongoose": "^5.11.96",
"@types/node": "^22.15.18",
"ts-node-dev": "^2.0.0",
"typescript": "^5.7.3"
"typescript": "^5.8.3"
},
"dependencies": {
"axios": "^1.9.0",
"body-parser": "^1.20.3",
"cors": "^2.8.5",
"dotenv": "^16.4.7",
"express": "^4.17.1",
"mongoose": "^8.14.1",
"dotenv": "^16.5.0",
"express": "^4.21.2",
"mongoose": "^8.15.0",
"ts-node": "^10.9.2"
}
}
1 change: 1 addition & 0 deletions src/config/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Sneaker } from "../schemas/sneaker";
import { Currency } from "../schemas/currency";
import { Store } from "../schemas/store";


import sneakerSeedData from "../../seeds/sneakers/sneakers.json";
import currencySeedData from "../../seeds/currencies.json";
import storeSeedData from "../../seeds/stores/stores.json";
Expand Down
Loading