openapi: 3.1.0 info: title: 9Eleven verison: 20250524 tags: - name: auth description: Authentication API - name: user description: User service API - name: shop description: Shop service API - name: cart description: Cart service API servers: - url: http://localhost:8080 description: User service - url: http://localhost:8081 description: Shop service - url: http://localhost:8082 description: Cart service paths: /auth: post: tags: - auth summary: Get JWT token via user credentials servers: - url: http://localhost:8080 requestBody: content: application/json: schema: $ref: '#/components/schemas/AuthCredentials' responses: 200: description: Successful operation content: application/json: schema: $ref: '#/components/schemas/AuthToken' 400: description: Credentials in request were missing or empty content: application/json: schema: $ref: '#/components/schemas/Error' 401: description: Invalid password for an existing user given content: application/json: $ref: '#/components/schemas/Error' 404: description: User with given login was not found content: application/json: $ref: '#/components/schemas/Error' /user: post: tags: - user summary: Create new user servers: - url: http://localhost:8080 requestBody: content: application/json: schema: $ref: '#/components/schemas/User' responses: 200: description: Successful operation content: application/json: schema: type: string 400: description: Required fields were empty content: application/json: schema: $ref: '#/components/schemas/Error' 409: description: User already exists content: application/json: schema: $ref: '#/components/schemas/Error' get: tags: - user summary: Find users by filter servers: - url: http://localhost:8080 security: - bearerAuth: [] parameters: - name: first_name in: query description: First name required: false schema: type: string - name: last_name in: query description: Second name required: false schema: type: string responses: 200: description: Successful operation content: application/json: schema: type: array items: $ref: '#/components/schemas/User' 401: $ref: '#/components/responses/UnauthorizedError' /user/{login}: parameters: - name: login in: path description: User login required: true schema: type: string get: tags: - user summary: Find user by login servers: - url: http://localhost:8080 security: - bearerAuth: [] responses: 200: description: Successful operation content: application/json: schema: $ref: '#/components/schemas/User' 404: description: User does not exist content: application/json: schema: $ref: '#/components/schemas/Error' 400: description: User login was not provided content: application/json: schema: $ref: '#/components/schemas/Error' 401: $ref: '#/components/responses/UnauthorizedError' put: tags: - user summary: Update user information by login servers: - url: http://localhost:8080 security: - bearerAuth: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/User' responses: 200: description: Successful operation content: application/json: schema: type: string 404: description: User does not exist content: application/json: schema: $ref: '#/components/schemas/Error' 400: description: Required fields were empty content: application/json: schema: $ref: '#/components/schemas/Error' 401: $ref: '#/components/responses/UnauthorizedError' delete: tags: - user summary: Delete user by login servers: - url: http://localhost:8080 security: - bearerAuth: [] responses: 200: description: Successful operation content: application/json: schema: type: string 404: description: User does not exist content: application/json: schema: $ref: '#/components/schemas/Error' 401: $ref: '#/components/responses/UnauthorizedError' /shop: post: tags: - shop summary: Create new product listing servers: - url: http://localhost:8081 security: - bearerAuth: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/ProductInfo' responses: 200: description: Successful product listing creation content: application/json: schema: $ref: '#/components/schemas/Product' 400: description: Required fields for product listing creation were empty content: application/json: schema: $ref: '#/components/schemas/Error' 409: description: Product listing already exists content: application/json: schema: $ref: '#/components/schemas/Error' 401: $ref: '#/components/responses/UnauthorizedError' get: tags: - shop summary: Get all product listings servers: - url: http://localhost:8081 responses: 200: description: Successful operation content: application/json: schema: type: array items: $ref: '#/components/schemas/Product' /shop/{id}: parameters: - name: id in: path description: Product id required: true schema: $ref: '#/components/schemas/ID' get: tags: - shop summary: Find product listing by ID servers: - url: http://localhost:8081 responses: 200: description: Successful operation content: application/json: schema: $ref: '#/components/schemas/Product' 404: description: Product listing does not exist content: application/json: schema: $ref: '#/components/schemas/Error' 400: description: Product listing ID was empty content: application/json: schema: $ref: '#/components/schemas/Error' put: tags: - shop summary: Update product listing by ID servers: - url: http://localhost:8081 security: - bearerAuth: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/ProductInfo' responses: 200: description: Successful operation content: application/json: schema: $ref: '#/components/schemas/Product' 404: description: Product listing does not exist content: application/json: schema: $ref: '#/components/schemas/Error' 400: description: Required fields for product listing update were empty content: application/json: schema: $ref: '#/components/schemas/Error' 401: $ref: '#/components/responses/UnauthorizedError' delete: tags: - shop summary: Delete product listing by login servers: - url: http://localhost:8081 security: - bearerAuth: [] responses: 200: description: Successful operation content: application/json: schema: type: string 404: description: User does not exist content: application/json: schema: $ref: '#/components/schemas/Error' 401: $ref: '#/components/responses/UnauthorizedError' /cart: post: tags: - cart summary: Add item to user cart servers: - url: http://localhost:8082 security: - bearerAuth: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/CartItem' responses: 200: description: Successful operation content: application/json: schema: type: array items: $ref: '#/components/schemas/CartItem' 404: description: Product ID not found content: application/json: schema: $ref: '#/components/schemas/Error' 400: description: Malformed request content: application/json: schema: $ref: '#/components/schemas/Error' 401: $ref: '#/components/responses/UnauthorizedError' get: tags: - cart summary: Get user cart contents servers: - url: http://localhost:8082 security: - bearerAuth: [] responses: 200: description: Successful operation content: application/json: schema: type: array items: $ref: '#/components/schemas/CartItem' 401: $ref: '#/components/responses/UnauthorizedError' delete: tags: - cart summary: Remove item from user cart servers: - url: http://localhost:8082 security: - bearerAuth: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/CartItem' responses: 200: description: Successful operation content: application/json: schema: type: array items: $ref: '#/components/schemas/CartItem' 404: description: Product ID not found content: application/json: schema: $ref: '#/components/schemas/Error' 400: description: Malformed request content: application/json: schema: $ref: '#/components/schemas/Error' 401: $ref: '#/components/responses/UnauthorizedError' components: securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT responses: UnauthorizedError: description: JWT token is missing or invalid content: application/json: schema: $ref: '#/components/schemas/Error' schemas: ID: type: integer format: int64 Error: type: object properties: code: type: string message: type: string required: - code - message User: type: object properties: login: type: string password: type: string format: password first_name: type: string last_name: type string required: - login - password - first_name - last_name ProductInfo: type: object properties: name: type: string description: type: string quantity: type: integer format: int32 price: type: integer format: int32 required: - name - quantity - price Product: allOf: - type: object properties: id: $ref: '#/components/schemas/ID' required: - id - $ref: '#/components/schemas/ProductInfo' AuthCredentials: type: object properties: login: type: string password: type: string required: - login - password AuthToken: type: object properties: token: type: string example: X.Y.Z type: type: string example: Bearer expires_on: type: string example: 1748011869 required: - token - type - expires_on CartItem: type: object properties: id: $ref: '#/components/schemas/ID' quantity: type: integer format: int32 required: - id - quantity