openapi: 3.0.0 info: title: Ahorro Wishlist Service API version: 1.0.0 description: API for managing user wishes in the Ahorro Wishlist Service. tags: - name: wishes description: Endpoints for wishes CRUD operations - name: system description: System endpoints (health/info) servers: - url: https://api.ahorro-wishlist.savak.vkdev1.com paths: /wishes/{userId}: options: summary: CORS support responses: '200': description: CORS response headers: Access-Control-Allow-Origin: schema: type: string Access-Control-Allow-Methods: schema: type: string Access-Control-Allow-Headers: schema: type: string x-amazon-apigateway-integration: type: mock requestTemplates: application/json: '{"statusCode": 200}' responses: default: statusCode: '200' responseParameters: method.response.header.Access-Control-Allow-Origin: "'*'" method.response.header.Access-Control-Allow-Methods: "'GET,POST,OPTIONS'" method.response.header.Access-Control-Allow-Headers: "'Content-Type,Authorization'" responseTemplates: application/json: '{}' get: tags: [wishes] summary: Get all wishes for a user parameters: - name: userId in: path required: true schema: type: string - name: sort_by in: query required: false schema: type: string enum: [priority, created, due] - name: order in: query required: false schema: type: string enum: [asc, desc] - name: limit in: query required: false schema: type: integer - name: next_token in: query required: false schema: type: string responses: '200': description: List of wishes content: application/json: schema: type: array items: $ref: '#/components/schemas/Wish' x-amazon-apigateway-integration: uri: "${wishlist_lambda_invoke_arn}" passthroughBehavior: when_no_match httpMethod: POST type: aws_proxy post: tags: [wishes] summary: Create a new wish for a user parameters: - name: userId in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Wish' responses: '201': description: Wish created content: application/json: schema: $ref: '#/components/schemas/Wish' x-amazon-apigateway-integration: uri: "${wishlist_lambda_invoke_arn}" passthroughBehavior: when_no_match httpMethod: POST type: aws_proxy /wishes/{userId}/{wishId}: options: summary: CORS support responses: '200': description: CORS response headers: Access-Control-Allow-Origin: schema: type: string Access-Control-Allow-Methods: schema: type: string Access-Control-Allow-Headers: schema: type: string x-amazon-apigateway-integration: type: mock requestTemplates: application/json: '{"statusCode": 200}' responses: default: statusCode: '200' responseParameters: method.response.header.Access-Control-Allow-Origin: "'*'" method.response.header.Access-Control-Allow-Methods: "'GET,PUT,DELETE,OPTIONS'" method.response.header.Access-Control-Allow-Headers: "'Content-Type,Authorization'" responseTemplates: application/json: '{}' get: tags: [wishes] summary: Get a specific wish for a user parameters: - name: userId in: path required: true schema: type: string - name: wishId in: path required: true schema: type: string responses: '200': description: Wish found content: application/json: schema: $ref: '#/components/schemas/Wish' '404': description: Wish not found x-amazon-apigateway-integration: uri: "${wishlist_lambda_invoke_arn}" passthroughBehavior: when_no_match httpMethod: POST type: aws_proxy put: tags: [wishes] summary: Update a wish for a user parameters: - name: userId in: path required: true schema: type: string - name: wishId in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Wish' responses: '200': description: Wish updated content: application/json: schema: $ref: '#/components/schemas/Wish' x-amazon-apigateway-integration: uri: "${wishlist_lambda_invoke_arn}" passthroughBehavior: when_no_match httpMethod: POST type: aws_proxy delete: tags: [wishes] summary: Delete a wish for a user parameters: - name: userId in: path required: true schema: type: string - name: wishId in: path required: true schema: type: string responses: '204': description: Wish deleted x-amazon-apigateway-integration: uri: "${wishlist_lambda_invoke_arn}" passthroughBehavior: when_no_match httpMethod: POST type: aws_proxy /wishes/all: options: summary: CORS support responses: '200': description: CORS response headers: Access-Control-Allow-Origin: schema: type: string Access-Control-Allow-Methods: schema: type: string Access-Control-Allow-Headers: schema: type: string x-amazon-apigateway-integration: type: mock requestTemplates: application/json: '{"statusCode": 200}' responses: default: statusCode: '200' responseParameters: method.response.header.Access-Control-Allow-Origin: "'*'" method.response.header.Access-Control-Allow-Methods: "'GET,OPTIONS'" method.response.header.Access-Control-Allow-Headers: "'Content-Type,Authorization'" responseTemplates: application/json: '{}' get: tags: [wishes] summary: Get all wishes (global) parameters: - name: sort_by in: query required: false schema: type: string enum: [priority, created, due] - name: order in: query required: false schema: type: string enum: [asc, desc] - name: limit in: query required: false schema: type: integer - name: next_token in: query required: false schema: type: string responses: '200': description: List of all wishes content: application/json: schema: type: array items: $ref: '#/components/schemas/Wish' x-amazon-apigateway-integration: uri: "${wishlist_lambda_invoke_arn}" passthroughBehavior: when_no_match httpMethod: POST type: aws_proxy /info: options: summary: CORS support responses: '200': description: CORS response headers: Access-Control-Allow-Origin: schema: type: string Access-Control-Allow-Methods: schema: type: string Access-Control-Allow-Headers: schema: type: string x-amazon-apigateway-integration: type: mock requestTemplates: application/json: '{"statusCode": 200}' responses: default: statusCode: '200' responseParameters: method.response.header.Access-Control-Allow-Origin: "'*'" method.response.header.Access-Control-Allow-Methods: "'GET,OPTIONS'" method.response.header.Access-Control-Allow-Headers: "'Content-Type,Authorization'" responseTemplates: application/json: '{}' get: tags: [system] summary: Get service info responses: '200': description: Service info content: application/json: schema: type: object x-amazon-apigateway-integration: uri: "${wishlist_lambda_invoke_arn}" passthroughBehavior: when_no_match httpMethod: POST type: aws_proxy /health: options: summary: CORS support responses: '200': description: CORS response headers: Access-Control-Allow-Origin: schema: type: string Access-Control-Allow-Methods: schema: type: string Access-Control-Allow-Headers: schema: type: string x-amazon-apigateway-integration: type: mock requestTemplates: application/json: '{"statusCode": 200}' responses: default: statusCode: '200' responseParameters: method.response.header.Access-Control-Allow-Origin: "'*'" method.response.header.Access-Control-Allow-Methods: "'GET,OPTIONS'" method.response.header.Access-Control-Allow-Headers: "'Content-Type,Authorization'" responseTemplates: application/json: '{}' get: tags: [system] summary: Health check responses: '200': description: Health check OK content: application/json: schema: type: object x-amazon-apigateway-integration: uri: "${wishlist_lambda_invoke_arn}" passthroughBehavior: when_no_match httpMethod: POST type: aws_proxy components: schemas: Wish: type: object properties: userId: type: string wishId: type: string title: type: string required: true content: type: string priority: type: integer due: type: string format: date-time x-amazon-apigateway-request-validators: validate-all: validateRequestBody: true validateRequestParameters: true x-amazon-apigateway-request-validator: "validate-all" x-amazon-apigateway-gateway-responses: ACCESS_DENIED: responseTemplates: application/json: '{"code":"APIGW_ERROR","message":"$context.authorizer.customErrorMessage","requestId":"$context.requestId"}' BAD_REQUEST_BODY: responseTemplates: application/json: '{"code":"APIGW_ERROR","message":"$context.error.message: $context.error.validationErrorString","requestId":"$context.requestId"}' DEFAULT_4XX: responseTemplates: application/json: '{"code":"APIGW_ERROR","message":"$context.error.message","requestId":"$context.requestId"}' DEFAULT_5XX: responseTemplates: application/json: '{"code":"APIGW_ERROR","message":"$context.error.message","requestId":"$context.requestId"}' UNAUTHORIZED: responseTemplates: application/json: '{"code":"APIGW_ERROR","message":"$context.error.message","requestId":"$context.requestId"}'