{"openapi":"3.0.3","info":{"title":"Dummy REST API","version":"1.0.0","description":"Fake REST API with realistic JSON for building and testing client apps.\n\nMutations update an in-memory store (not static fixtures). Use `POST /api/reset`\nwith header `X-Reset-Token` to restore seed data between test runs.\n\nSecurity controls include rate limiting, helmet headers, payload allowlisting,\nprototype-pollution rejection, bcrypt password hashing, JWT auth, and X-API-Key for writes.\n\n**Auth flow**\n1. `POST /api/login` or `POST /api/register` → receive `token`\n2. Send `Authorization: Bearer <token>` on `/api/me` and every resource endpoint\n   (`/api/users`, `/api/products`, `/api/posts`, `/api/todos`, `/api/carts`)\n3. Mutations also require header `X-API-Key`\n\n**Sample credentials**\n- `emily.johnson@example.com` / `emilyspass`\n- username `michaelw` / `michaelwpass`\n","contact":{"name":"Dummy REST API"}},"servers":[{"url":"https://dummyapi.amine-salih.com","description":"Current host"},{"url":"http://localhost:3000","description":"Local Docker / default"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Auth"},{"name":"Users"},{"name":"Products"},{"name":"Posts"},{"name":"Todos"},{"name":"Carts"},{"name":"Utility"},{"name":"Docs"}],"paths":{"/api/docs":{"get":{"tags":["Docs"],"summary":"Swagger UI","description":"Interactive OpenAPI documentation","operationId":"getSwaggerUi","security":[],"responses":{"200":{"description":"HTML Swagger UI","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/api/openapi.yaml":{"get":{"tags":["Docs"],"summary":"OpenAPI specification (YAML)","operationId":"getOpenApiYaml","security":[],"responses":{"200":{"description":"OpenAPI 3.0 YAML","content":{"application/yaml":{"schema":{"type":"string"}}}}}}},"/api/openapi.json":{"get":{"tags":["Docs"],"summary":"OpenAPI specification (JSON)","operationId":"getOpenApiJson","security":[],"responses":{"200":{"description":"OpenAPI 3.0 JSON","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/":{"get":{"tags":["Utility"],"summary":"Landing page","operationId":"getLandingPage","security":[],"responses":{"200":{"description":"HTML landing page explaining the API","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/api":{"get":{"tags":["Utility"],"summary":"API overview (JSON)","operationId":"getOverview","security":[],"responses":{"200":{"description":"Endpoint map and sample credentials","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/api/health":{"get":{"tags":["Utility"],"summary":"Health check","operationId":"getHealth","security":[],"responses":{"200":{"description":"Service is healthy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}}}}},"/api/reset":{"post":{"tags":["Utility"],"summary":"Reset in-memory store to seed data","description":"Requires the `X-Reset-Token` header matching the server `RESET_TOKEN` env var.","operationId":"resetStore","security":[],"parameters":[{"name":"X-Reset-Token","in":"header","required":true,"schema":{"type":"string"},"description":"Shared reset secret configured via RESET_TOKEN"}],"responses":{"200":{"description":"Store restored","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"status":{"type":"string","example":"ok"}}}}}},"403":{"description":"Missing/invalid reset token, or reset disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/register":{"post":{"tags":["Auth"],"summary":"Register a new user","description":"Returns a JWT on success. Responds with 400 when required fields are missing.","operationId":"register","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"},"examples":{"valid":{"value":{"email":"new.dev@example.com","password":"secret12","username":"newdev","firstName":"New","lastName":"Dev"}},"missingFields":{"value":{"email":"incomplete@example.com"}}}}}},"responses":{"201":{"description":"User created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"400":{"description":"Missing or invalid fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorWithMissingFields"},"example":{"message":"Missing required fields","missingFields":["password","username"]}}}},"409":{"description":"Email or username already taken","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/login":{"post":{"tags":["Auth"],"summary":"Login","security":[],"description":"Accepts `email` + `password`, or `username` + `password`.\nReturns a JWT on success. Responds with 400 on missing fields or invalid credentials.\n","operationId":"login","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"},"examples":{"byEmail":{"value":{"email":"emily.johnson@example.com","password":"emilyspass"}},"byUsername":{"value":{"username":"michaelw","password":"michaelwpass"}}}}}},"responses":{"200":{"description":"Authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"400":{"description":"Missing fields or invalid credentials","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ErrorWithMissingFields"},{"$ref":"#/components/schemas/Error"}]},"examples":{"missing":{"value":{"message":"Missing required fields","missingFields":["email","password"]}},"invalid":{"value":{"message":"Invalid credentials"}}}}}}}}},"/api/me":{"get":{"tags":["Auth"],"summary":"Current authenticated user","operationId":"getMe","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Current user (password excluded)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/users":{"get":{"tags":["Users"],"summary":"List users","operationId":"listUsers","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/skip"},{"$ref":"#/components/parameters/q"}],"responses":{"200":{"description":"Paginated users","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserList"}}}}}},"post":{"tags":["Users"],"summary":"Create user","operationId":"createUser","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreate"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"409":{"description":"Email already registered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/users/{id}":{"parameters":[{"$ref":"#/components/parameters/id"}],"get":{"tags":["Users"],"summary":"Get user by id","operationId":"getUser","responses":{"200":{"description":"User found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"}}},"put":{"tags":["Users"],"summary":"Replace user","operationId":"replaceUser","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserWrite"}}}},"responses":{"200":{"description":"Replaced","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"}}},"patch":{"tags":["Users"],"summary":"Partially update user","operationId":"patchUser","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserWrite"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"tags":["Users"],"summary":"Delete user","operationId":"deleteUser","responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletedUser"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/api/products":{"get":{"tags":["Products"],"summary":"List products","operationId":"listProducts","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/skip"},{"$ref":"#/components/parameters/q"},{"name":"category","in":"query","schema":{"type":"string"},"description":"Filter by category"}],"responses":{"200":{"description":"Paginated products","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductList"}}}}}},"post":{"tags":["Products"],"summary":"Create product","operationId":"createProduct","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductCreate"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"400":{"$ref":"#/components/responses/BadRequest"}}}},"/api/products/{id}":{"parameters":[{"$ref":"#/components/parameters/id"}],"get":{"tags":["Products"],"summary":"Get product by id","operationId":"getProduct","responses":{"200":{"description":"Product found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"}}},"put":{"tags":["Products"],"summary":"Replace product","operationId":"replaceProduct","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductWrite"}}}},"responses":{"200":{"description":"Replaced","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"}}},"patch":{"tags":["Products"],"summary":"Partially update product","operationId":"patchProduct","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductWrite"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"tags":["Products"],"summary":"Delete product","operationId":"deleteProduct","responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletedProduct"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/api/posts":{"get":{"tags":["Posts"],"summary":"List posts","operationId":"listPosts","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/skip"},{"$ref":"#/components/parameters/q"},{"$ref":"#/components/parameters/userId"}],"responses":{"200":{"description":"Paginated posts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostList"}}}}}},"post":{"tags":["Posts"],"summary":"Create post","operationId":"createPost","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostCreate"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"400":{"$ref":"#/components/responses/BadRequest"}}}},"/api/posts/{id}":{"parameters":[{"$ref":"#/components/parameters/id"}],"get":{"tags":["Posts"],"summary":"Get post by id","operationId":"getPost","responses":{"200":{"description":"Post found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"}}},"put":{"tags":["Posts"],"summary":"Replace post","operationId":"replacePost","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostWrite"}}}},"responses":{"200":{"description":"Replaced","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"}}},"patch":{"tags":["Posts"],"summary":"Partially update post","operationId":"patchPost","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostWrite"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"tags":["Posts"],"summary":"Delete post","operationId":"deletePost","responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletedPost"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/api/todos":{"get":{"tags":["Todos"],"summary":"List todos","operationId":"listTodos","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/skip"},{"$ref":"#/components/parameters/q"},{"$ref":"#/components/parameters/userId"},{"name":"completed","in":"query","schema":{"type":"boolean"},"description":"Filter by completion status"}],"responses":{"200":{"description":"Paginated todos","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TodoList"}}}}}},"post":{"tags":["Todos"],"summary":"Create todo","operationId":"createTodo","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TodoCreate"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Todo"}}}},"400":{"$ref":"#/components/responses/BadRequest"}}}},"/api/todos/{id}":{"parameters":[{"$ref":"#/components/parameters/id"}],"get":{"tags":["Todos"],"summary":"Get todo by id","operationId":"getTodo","responses":{"200":{"description":"Todo found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Todo"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"}}},"put":{"tags":["Todos"],"summary":"Replace todo","operationId":"replaceTodo","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TodoWrite"}}}},"responses":{"200":{"description":"Replaced","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Todo"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"}}},"patch":{"tags":["Todos"],"summary":"Partially update todo","operationId":"patchTodo","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TodoWrite"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Todo"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"tags":["Todos"],"summary":"Delete todo","operationId":"deleteTodo","responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletedTodo"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/api/carts":{"get":{"tags":["Carts"],"summary":"List carts","operationId":"listCarts","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/skip"},{"$ref":"#/components/parameters/userId"}],"responses":{"200":{"description":"Paginated carts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CartList"}}}}}},"post":{"tags":["Carts"],"summary":"Create cart","operationId":"createCart","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CartCreate"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Cart"}}}},"400":{"$ref":"#/components/responses/BadRequest"}}}},"/api/carts/{id}":{"parameters":[{"$ref":"#/components/parameters/id"}],"get":{"tags":["Carts"],"summary":"Get cart by id","operationId":"getCart","responses":{"200":{"description":"Cart found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Cart"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"}}},"put":{"tags":["Carts"],"summary":"Replace cart","operationId":"replaceCart","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CartWrite"}}}},"responses":{"200":{"description":"Replaced","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Cart"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"}}},"patch":{"tags":["Carts"],"summary":"Partially update cart","operationId":"patchCart","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CartWrite"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Cart"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"tags":["Carts"],"summary":"Delete cart","operationId":"deleteCart","responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletedCart"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"apiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Required in addition to Bearer JWT for POST/PUT/PATCH/DELETE on resource endpoints"}},"parameters":{"id":{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1},"description":"Resource id"},"limit":{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":30},"description":"Page size"},"skip":{"name":"skip","in":"query","schema":{"type":"integer","minimum":0,"default":0},"description":"Number of items to skip"},"q":{"name":"q","in":"query","schema":{"type":"string"},"description":"Search query"},"userId":{"name":"userId","in":"query","schema":{"type":"integer"},"description":"Filter by owning user id"}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ErrorWithMissingFields"}]}}}},"NotFound":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}},"ErrorWithMissingFields":{"type":"object","required":["message","missingFields"],"properties":{"message":{"type":"string","example":"Missing required fields"},"missingFields":{"type":"array","items":{"type":"string"},"example":["email","password"]}}},"Health":{"type":"object","properties":{"status":{"type":"string","example":"ok"},"uptime":{"type":"number"}}},"Address":{"type":"object","properties":{"street":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"postalCode":{"type":"string"},"country":{"type":"string"}}},"User":{"type":"object","properties":{"id":{"type":"integer"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string","format":"email"},"username":{"type":"string"},"phone":{"type":"string"},"age":{"type":"integer","nullable":true},"gender":{"type":"string"},"image":{"type":"string","format":"uri"},"address":{"$ref":"#/components/schemas/Address"}}},"UserCreate":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string","format":"email"},"password":{"type":"string","minLength":1},"username":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"phone":{"type":"string"},"age":{"type":"integer"},"gender":{"type":"string"},"image":{"type":"string"},"address":{"$ref":"#/components/schemas/Address"}}},"UserWrite":{"type":"object","properties":{"email":{"type":"string","format":"email"},"password":{"type":"string"},"username":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"phone":{"type":"string"},"age":{"type":"integer","nullable":true},"gender":{"type":"string"},"image":{"type":"string"},"address":{"$ref":"#/components/schemas/Address"}}},"UserList":{"type":"object","properties":{"users":{"type":"array","items":{"$ref":"#/components/schemas/User"}},"total":{"type":"integer"},"skip":{"type":"integer"},"limit":{"type":"integer"}}},"DeletedUser":{"allOf":[{"$ref":"#/components/schemas/User"},{"$ref":"#/components/schemas/DeletionMeta"}]},"RegisterRequest":{"type":"object","required":["email","password","username"],"properties":{"email":{"type":"string","format":"email"},"password":{"type":"string","minLength":6},"username":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"phone":{"type":"string"},"age":{"type":"integer"},"gender":{"type":"string"},"image":{"type":"string"},"address":{"$ref":"#/components/schemas/Address"}}},"LoginRequest":{"type":"object","required":["password"],"properties":{"email":{"type":"string","description":"Email or leave empty and provide username"},"username":{"type":"string","description":"Alternative to email"},"password":{"type":"string"}}},"AuthResponse":{"allOf":[{"$ref":"#/components/schemas/User"},{"type":"object","required":["token"],"properties":{"token":{"type":"string","description":"JWT access token"}}}]},"Product":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"description":{"type":"string"},"category":{"type":"string"},"price":{"type":"number","format":"float"},"discountPercentage":{"type":"number","format":"float"},"rating":{"type":"number","format":"float"},"stock":{"type":"integer"},"brand":{"type":"string"},"thumbnail":{"type":"string"},"images":{"type":"array","items":{"type":"string"}}}},"ProductCreate":{"type":"object","required":["title","price"],"properties":{"title":{"type":"string"},"price":{"type":"number"},"description":{"type":"string"},"category":{"type":"string"},"discountPercentage":{"type":"number"},"rating":{"type":"number"},"stock":{"type":"integer"},"brand":{"type":"string"},"thumbnail":{"type":"string"},"images":{"type":"array","items":{"type":"string"}}}},"ProductWrite":{"type":"object","properties":{"title":{"type":"string"},"price":{"type":"number"},"description":{"type":"string"},"category":{"type":"string"},"discountPercentage":{"type":"number"},"rating":{"type":"number"},"stock":{"type":"integer"},"brand":{"type":"string"},"thumbnail":{"type":"string"},"images":{"type":"array","items":{"type":"string"}}}},"ProductList":{"type":"object","properties":{"products":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"total":{"type":"integer"},"skip":{"type":"integer"},"limit":{"type":"integer"}}},"DeletedProduct":{"allOf":[{"$ref":"#/components/schemas/Product"},{"$ref":"#/components/schemas/DeletionMeta"}]},"Reactions":{"type":"object","properties":{"likes":{"type":"integer"},"dislikes":{"type":"integer"}}},"Post":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"body":{"type":"string"},"userId":{"type":"integer"},"tags":{"type":"array","items":{"type":"string"}},"reactions":{"$ref":"#/components/schemas/Reactions"},"views":{"type":"integer"}}},"PostCreate":{"type":"object","required":["title","body"],"properties":{"title":{"type":"string"},"body":{"type":"string"},"userId":{"type":"integer"},"tags":{"type":"array","items":{"type":"string"}},"reactions":{"$ref":"#/components/schemas/Reactions"},"views":{"type":"integer"}}},"PostWrite":{"type":"object","properties":{"title":{"type":"string"},"body":{"type":"string"},"userId":{"type":"integer"},"tags":{"type":"array","items":{"type":"string"}},"reactions":{"$ref":"#/components/schemas/Reactions"},"views":{"type":"integer"}}},"PostList":{"type":"object","properties":{"posts":{"type":"array","items":{"$ref":"#/components/schemas/Post"}},"total":{"type":"integer"},"skip":{"type":"integer"},"limit":{"type":"integer"}}},"DeletedPost":{"allOf":[{"$ref":"#/components/schemas/Post"},{"$ref":"#/components/schemas/DeletionMeta"}]},"Todo":{"type":"object","properties":{"id":{"type":"integer"},"todo":{"type":"string"},"completed":{"type":"boolean"},"userId":{"type":"integer"}}},"TodoCreate":{"type":"object","required":["todo"],"properties":{"todo":{"type":"string"},"completed":{"type":"boolean"},"userId":{"type":"integer"}}},"TodoWrite":{"type":"object","properties":{"todo":{"type":"string"},"completed":{"type":"boolean"},"userId":{"type":"integer"}}},"TodoList":{"type":"object","properties":{"todos":{"type":"array","items":{"$ref":"#/components/schemas/Todo"}},"total":{"type":"integer"},"skip":{"type":"integer"},"limit":{"type":"integer"}}},"DeletedTodo":{"allOf":[{"$ref":"#/components/schemas/Todo"},{"$ref":"#/components/schemas/DeletionMeta"}]},"CartProduct":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"price":{"type":"number"},"quantity":{"type":"integer"},"total":{"type":"number"},"discountPercentage":{"type":"number"},"discountedTotal":{"type":"number"}}},"Cart":{"type":"object","properties":{"id":{"type":"integer"},"userId":{"type":"integer"},"products":{"type":"array","items":{"$ref":"#/components/schemas/CartProduct"}},"total":{"type":"number"},"discountedTotal":{"type":"number"},"totalProducts":{"type":"integer"},"totalQuantity":{"type":"integer"}}},"CartCreate":{"type":"object","required":["userId"],"properties":{"userId":{"type":"integer"},"products":{"type":"array","items":{"$ref":"#/components/schemas/CartProduct"}},"total":{"type":"number"},"discountedTotal":{"type":"number"}}},"CartWrite":{"type":"object","properties":{"userId":{"type":"integer"},"products":{"type":"array","items":{"$ref":"#/components/schemas/CartProduct"}},"total":{"type":"number"},"discountedTotal":{"type":"number"},"totalProducts":{"type":"integer"},"totalQuantity":{"type":"integer"}}},"CartList":{"type":"object","properties":{"carts":{"type":"array","items":{"$ref":"#/components/schemas/Cart"}},"total":{"type":"integer"},"skip":{"type":"integer"},"limit":{"type":"integer"}}},"DeletedCart":{"allOf":[{"$ref":"#/components/schemas/Cart"},{"$ref":"#/components/schemas/DeletionMeta"}]},"DeletionMeta":{"type":"object","properties":{"isDeleted":{"type":"boolean","example":true},"deletedOn":{"type":"string","format":"date-time"}}}}}}