{ "openapi": "3.0.3", "info": { "title": "quiva.ai Gateway", "description": "quiva.ai Gateway API for managing gateway infrastructure and routing API requests.", "version": "1.0.0", "contact": { "name": "quiva.ai Support", "email": "support@quiva.ai" } }, "servers": [ { "url": "https://api.quiva.ai", "description": "Production API server" } ], "tags": [ { "name": "Gateways", "description": "Gateway management endpoints" }, { "name": "Mappings", "description": "Gateway Mapping management endpoints" }, { "name": "Mapping Versions", "description": "Gateway Mapping Version management endpoints" } ], "security": [ { "bearer_auth": [] }, { "api_key_auth": [] } ], "paths": { "/gateway": { "post": { "tags": [ "Gateways" ], "summary": "Create a new gateway", "description": "Creates a new gateway with a unique topic and URL.", "operationId": "postGateway", "x-resource-type": "service", "x-resource": "microstrate.gateway.post.gateway", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GatewayCreateRequest" }, "examples": { "basic_gateway": { "value": { "name": "My API Gateway", "description": "Gateway for my service APIs", "active": true } } } } } }, "responses": { "200": { "description": "Gateway created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GatewayResponseWrapper" }, "example": { "body": { "name": "My API Gateway", "description": "Gateway for my service APIs", "url": "https://abc123.quiva.ai", "subject": "ms.gateway.abcdef123456.gateway", "active": true, "timeout": 30000, "limit": { "request": 10000, "time": 1000 }, "modified": 1713531894, "type": "created" }, "metadata": { "subject": "ms.gateway.abcdef123456.gateway" } } } } }, "400": { "$ref": "#/components/responses/BadRequest" } } } }, "/gateway/{gateway_topic}": { "get": { "tags": [ "Gateways" ], "summary": "Get a specific gateway", "description": "Retrieves details about a specific gateway.", "operationId": "getGateway", "x-resource-type": "service", "x-resource": "microstrate.gateway.get.gateway", "parameters": [ { "$ref": "#/components/parameters/gateway_topic_param" } ], "responses": { "200": { "description": "Gateway details retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GatewayResponseWrapper" }, "example": { "body": { "name": "My API Gateway", "description": "Gateway for my service APIs", "url": "https://abc123.quiva.ai", "subject": "ms.gateway.abcdef123456.gateway", "active": true, "timeout": 30000, "limit": { "request": 10000, "time": 1000 }, "modified": 1713531894, "type": "created" }, "metadata": { "subject": "ms.gateway.abcdef123456.gateway" } } } } }, "404": { "$ref": "#/components/responses/NotFound" } } }, "patch": { "tags": [ "Gateways" ], "summary": "Update a gateway", "description": "Updates an existing gateway's configuration.", "operationId": "patchGateway", "x-resource-type": "service", "x-resource": "microstrate.gateway.patch.gateway", "parameters": [ { "$ref": "#/components/parameters/gateway_topic_param" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GatewayUpdateRequest" }, "example": { "name": "Updated Gateway Name", "description": "Updated description for my gateway", "active": true, "timeout": 60000, "limit": { "request": 5000, "time": 1000 } } } } }, "responses": { "200": { "description": "Gateway updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" }, "example": { "message": "success" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" } } }, "delete": { "tags": [ "Gateways" ], "summary": "Delete a gateway", "description": "Marks a gateway as deleted (poison-pilled).", "operationId": "deleteGateway", "x-resource-type": "service", "x-resource": "microstrate.gateway.delete.item", "parameters": [ { "$ref": "#/components/parameters/gateway_topic_param" } ], "responses": { "200": { "description": "Gateway marked as deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" }, "example": { "message": "success" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/gateway/all": { "get": { "tags": [ "Gateways" ], "summary": "Get all gateways", "description": "Retrieves a list of all available gateways.", "operationId": "getAllGateways", "x-resource-type": "service", "x-resource": "microstrate.gateway.get.all-gateways", "responses": { "200": { "description": "List of gateways retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GatewayListResponseWrapper" }, "example": { "body": { "results": [ { "name": "Gateway 1", "description": "First gateway", "subject": "ms.gateway.abc123.gateway", "active": true, "timeout": 30000, "limit": { "request": 10000, "time": 1000 }, "modified": 1713531894, "type": "created" }, { "name": "Gateway 2", "description": "Second gateway", "subject": "ms.gateway.def456.gateway", "active": true, "timeout": 60000, "limit": { "request": 5000, "time": 1000 }, "modified": 1713532000, "type": "created" } ], "results_total": 2 }, "metadata": { "subject": "gateway.*.gateway.>" } } } } }, "400": { "$ref": "#/components/responses/BadRequest" } } } }, "/gateway/{gateway_topic}/mapping": { "post": { "tags": [ "Mappings" ], "summary": "Create a new mapping for a gateway", "description": "Creates a new path mapping within the specified gateway.", "operationId": "postGatewayMapping", "x-resource-type": "service", "x-resource": "microstrate.gateway.post.mapping", "parameters": [ { "$ref": "#/components/parameters/gateway_topic_param" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MappingCreateRequest" }, "example": { "path": "/api/users", "method": "GET", "is_public": true, "timeout": 30000, "limit": { "request": 5000, "time": 1000 } } } } }, "responses": { "200": { "description": "Mapping created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MappingResponseWrapper" }, "example": { "body": { "subject": "ms.gateway.abcdef123456.mapping.get.api.users", "path": "/api/users", "method": "GET", "is_public": true, "timeout": 30000, "limit": { "request": 5000, "time": 1000 }, "traffic_distribution": { "1": 100 }, "modified": 1713531894, "type": "created" }, "metadata": { "subject": "ms.gateway.abcdef123456.mapping.get.api.users" } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" } } }, "get": { "tags": [ "Mappings" ], "summary": "Get all mappings for a gateway", "description": "Retrieves all mappings defined for the specified gateway.", "operationId": "getGatewayMappings", "x-resource-type": "service", "x-resource": "microstrate.gateway.get.mappings", "parameters": [ { "$ref": "#/components/parameters/gateway_topic_param" } ], "responses": { "200": { "description": "List of mappings retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MappingListResponseWrapper" }, "example": { "body": { "results": [ { "subject": "ms.gateway.abcdef123456.mapping.get.api.users", "path": "/api/users", "method": "GET", "is_public": true, "timeout": 30000, "limit": { "request": 5000, "time": 1000 }, "traffic_distribution": { "1": 100 }, "modified": 1713531894, "type": "created" }, { "subject": "ms.gateway.abcdef123456.mapping.post.api.users", "path": "/api/users", "method": "POST", "is_public": true, "timeout": 30000, "limit": { "request": 5000, "time": 1000 }, "traffic_distribution": {}, "modified": 1713532000, "type": "created" } ], "results_total": 2 }, "metadata": { "subject": "ms.gateway.abcdef123456.mapping.>" } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/gateway/{gateway_topic}/mapping/details": { "get": { "tags": [ "Mappings" ], "summary": "Get a specific mapping", "description": "Retrieves information about a specific gateway mapping.", "operationId": "getGatewayMapping", "x-resource-type": "service", "x-resource": "microstrate.gateway.get.mapping", "parameters": [ { "$ref": "#/components/parameters/gateway_topic_param" }, { "$ref": "#/components/parameters/method_query_param" }, { "$ref": "#/components/parameters/path_query_param" } ], "responses": { "200": { "description": "Mapping details retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MappingResponseWrapper" }, "example": { "body": { "subject": "ms.gateway.abcdef123456.mapping.get.api.users", "path": "/api/users", "method": "GET", "is_public": true, "timeout": 30000, "limit": { "request": 5000, "time": 1000 }, "traffic_distribution": { "1": 100 }, "modified": 1713531894, "type": "created" }, "metadata": { "subject": "ms.gateway.abcdef123456.mapping.get.api.users" } } } } }, "404": { "$ref": "#/components/responses/NotFound" } } }, "patch": { "tags": [ "Mappings" ], "summary": "Update a mapping", "description": "Updates an existing gateway mapping configuration.", "operationId": "patchGatewayMapping", "x-resource-type": "service", "x-resource": "microstrate.gateway.patch.mapping", "parameters": [ { "$ref": "#/components/parameters/gateway_topic_param" }, { "$ref": "#/components/parameters/method_query_param" }, { "$ref": "#/components/parameters/path_query_param" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MappingUpdateRequest" }, "example": { "path": "/api/users/v2", "is_public": false, "timeout": 60000, "limit": { "request": 1000, "time": 1000 } } } } }, "responses": { "200": { "description": "Mapping updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" }, "example": { "message": "success" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" } } }, "delete": { "tags": [ "Mappings" ], "summary": "Delete a mapping", "description": "Marks a gateway mapping as deleted (poison-pilled).", "operationId": "deleteMapping", "x-resource-type": "service", "x-resource": "microstrate.gateway.delete.item", "parameters": [ { "$ref": "#/components/parameters/gateway_topic_param" }, { "$ref": "#/components/parameters/method_query_param" }, { "$ref": "#/components/parameters/path_query_param" } ], "responses": { "200": { "description": "Mapping marked as deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" }, "example": { "message": "success" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/gateway/mapping/all": { "get": { "tags": [ "Mappings" ], "summary": "Get all mappings", "description": "Retrieves a list of all available gateway mappings.", "operationId": "getAllGatewayMappings", "x-resource-type": "service", "x-resource": "microstrate.gateway.get.all-mappings", "responses": { "200": { "description": "List of mappings retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MappingListResponseWrapper" }, "example": { "body": { "results": [ { "subject": "ms.gateway.abc123.mapping.get.api.users", "path": "/api/users", "method": "GET", "is_public": true, "timeout": 30000, "limit": { "request": 5000, "time": 1000 }, "traffic_distribution": {}, "modified": 1713531894, "type": "created" }, { "subject": "ms.gateway.def456.mapping.post.api.products", "path": "/api/products", "method": "POST", "is_public": true, "timeout": 30000, "limit": { "request": 5000, "time": 1000 }, "traffic_distribution": {}, "modified": 1713532000, "type": "created" } ], "results_total": 2 }, "metadata": { "subject": "gateway.*.mapping.>" } } } } }, "400": { "$ref": "#/components/responses/BadRequest" } } } }, "/gateway/{gateway_topic}/mapping/version": { "post": { "tags": [ "Mapping Versions" ], "summary": "Create a new mapping version", "description": "Creates a new version for an existing mapping.", "operationId": "postGatewayMappingVersion", "x-resource-type": "service", "x-resource": "microstrate.gateway.post.mapping-version", "parameters": [ { "$ref": "#/components/parameters/gateway_topic_param" }, { "$ref": "#/components/parameters/method_query_param" }, { "$ref": "#/components/parameters/path_query_param" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MappingVersionCreateRequest" }, "example": { "resource_type": "function", "resource": "user-service.getUsers", "resource_version": "latest", "active": true, "description": "Gets all users with pagination" } } } }, "responses": { "200": { "description": "Mapping version created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MappingVersionResponseWrapper" }, "example": { "body": { "subject": "ms.gateway.abcdef123456.mapping-version.get.api.users.1", "resource_type": "function", "resource": "user-service.getUsers", "resource_version": "latest", "active": true, "description": "Gets all users with pagination", "version": 1, "modified": 1713531894, "type": "created" }, "metadata": { "subject": "ms.gateway.abcdef123456.mapping-version.get.api.users.1" } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" } } }, "get": { "tags": [ "Mapping Versions" ], "summary": "Get all versions for a mapping", "description": "Retrieves all versions defined for a specific mapping.", "operationId": "getGatewayMappingVersions", "x-resource-type": "service", "x-resource": "microstrate.gateway.get.mapping-versions", "parameters": [ { "$ref": "#/components/parameters/gateway_topic_param" }, { "$ref": "#/components/parameters/method_query_param" }, { "$ref": "#/components/parameters/path_query_param" } ], "responses": { "200": { "description": "List of mapping versions retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MappingVersionListResponseWrapper" }, "example": { "body": { "results": [ { "subject": "ms.gateway.abcdef123456.mapping-version.get.api.users.1", "resource_type": "function", "resource": "user-service.getUsers", "resource_version": "latest", "active": true, "description": "Initial version", "version": 1, "modified": 1713531894, "type": "created" }, { "subject": "ms.gateway.abcdef123456.mapping-version.get.api.users.2", "resource_type": "function", "resource": "user-service.getUsersV2", "resource_version": "latest", "active": true, "description": "Improved version with better filtering", "version": 2, "modified": 1713532000, "type": "created" } ], "results_total": 2 }, "metadata": { "subject": "ms.gateway.abcdef123456.mapping-version.get.api.users.>" } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/gateway/mapping-version/{gateway_topic}/{version_number}": { "get": { "tags": [ "Mapping Versions" ], "summary": "Get a specific mapping version", "description": "Retrieves information about a specific mapping version.", "operationId": "getGatewayMappingVersion", "x-resource-type": "service", "x-resource": "microstrate.gateway.get.mapping-version", "parameters": [ { "$ref": "#/components/parameters/gateway_topic_param" }, { "$ref": "#/components/parameters/version_number_param" }, { "$ref": "#/components/parameters/method_query_param" }, { "$ref": "#/components/parameters/path_query_param" } ], "responses": { "200": { "description": "Mapping version details retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MappingVersionResponseWrapper" }, "example": { "body": { "subject": "ms.gateway.abcdef123456.mapping-version.get.api.users.1", "resource_type": "function", "resource": "user-service.getUsers", "resource_version": "latest", "active": true, "description": "Gets all users with pagination", "version": 1, "modified": 1713531894, "type": "created" }, "metadata": { "subject": "ms.gateway.abcdef123456.mapping-version.get.api.users.1" } } } } }, "404": { "$ref": "#/components/responses/NotFound" } } }, "patch": { "tags": [ "Mapping Versions" ], "summary": "Update a mapping version", "description": "Updates an existing mapping version configuration.", "operationId": "patchGatewayMappingVersion", "x-resource-type": "service", "x-resource": "microstrate.gateway.patch.mapping-version", "parameters": [ { "$ref": "#/components/parameters/gateway_topic_param" }, { "$ref": "#/components/parameters/version_number_param" }, { "$ref": "#/components/parameters/method_query_param" }, { "$ref": "#/components/parameters/path_query_param" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MappingVersionUpdateRequest" }, "example": { "active": false, "description": "Updated description for version 1" } } } }, "responses": { "200": { "description": "Mapping version updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" }, "example": { "message": "success" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" } } }, "delete": { "tags": [ "Mapping Versions" ], "summary": "Delete a mapping version", "description": "Marks a mapping version as deleted (poison-pilled).", "operationId": "deleteMappingVersion", "x-resource-type": "service", "x-resource": "microstrate.gateway.delete.item", "parameters": [ { "$ref": "#/components/parameters/gateway_topic_param" }, { "$ref": "#/components/parameters/version_number_param" }, { "$ref": "#/components/parameters/method_query_param" }, { "$ref": "#/components/parameters/path_query_param" } ], "responses": { "200": { "description": "Mapping version marked as deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" }, "example": { "message": "success" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/gateway/mapping-version/all": { "get": { "tags": [ "Mapping Versions" ], "summary": "Get all mapping versions", "description": "Retrieves a list of all available mapping versions.", "operationId": "getAllGatewayMappingVersions", "x-resource-type": "service", "x-resource": "microstrate.gateway.get.all-mapping-versions", "responses": { "200": { "description": "List of mapping versions retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MappingVersionListResponseWrapper" }, "example": { "body": { "results": [ { "subject": "ms.gateway.abc123.mapping-version.get.api.users.1", "resource_type": "function", "resource": "user-service.getUsers", "resource_version": "latest", "active": true, "description": "Version 1", "version": 1, "modified": 1713531894, "type": "created" }, { "subject": "ms.gateway.def456.mapping-version.post.api.products.1", "resource_type": "function", "resource": "product-service.createProduct", "resource_version": "latest", "active": true, "description": "Version 1", "version": 1, "modified": 1713532000, "type": "created" } ], "results_total": 2 }, "metadata": { "subject": "gateway.*.mapping-version.>" } } } } }, "400": { "$ref": "#/components/responses/BadRequest" } } } } }, "components": { "securitySchemes": { "bearer_auth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" }, "api_key_auth": { "type": "apiKey", "in": "header", "name": "X-Api-Key" } }, "parameters": { "path_param": { "name": "path", "in": "path", "description": "Path segment of the mapping in dot notation", "required": true, "schema": { "type": "string" }, "example": "api.users" }, "method_param": { "name": "method", "in": "path", "description": "HTTP method for the mapping in lowercase", "required": true, "schema": { "type": "string", "enum": [ "get", "post", "put", "delete", "patch", "options", "head" ] }, "example": "get" }, "gateway_topic_param": { "name": "gateway_topic", "in": "path", "description": "Unique topic identifier of the gateway", "required": true, "schema": { "type": "string" }, "example": "abcdef123456" }, "version_number_param": { "name": "version_number", "in": "path", "description": "Sequential version number of the mapping version", "required": true, "schema": { "type": "integer" }, "example": 1 }, "method_query_param": { "name": "method", "in": "query", "description": "HTTP method for the mapping in uppercase", "required": true, "schema": { "type": "string", "enum": [ "GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD" ] }, "example": "GET" }, "path_query_param": { "name": "path", "in": "query", "description": "URL path for the mapping including the leading slash", "required": true, "schema": { "type": "string" }, "example": "/api/users" } }, "schemas": { "Limit": { "type": "object", "properties": { "request": { "type": "integer", "description": "Maximum number of requests allowed", "default": 10000, "example": 5000 }, "time": { "type": "integer", "description": "Time window for rate limiting in milliseconds", "default": 1000, "example": 1000 } } }, "Middleware": { "type": "object", "properties": { "order": { "type": "integer", "description": "Execution order of the middleware", "example": 1 }, "resource": { "type": "string", "description": "Resource identifier for the middleware function", "example": "auth-middleware" }, "resource_type": { "type": "string", "description": "Type of resource the middleware points to", "example": "function", "enum": [ "function", "service" ] }, "resource_version": { "type": "string", "description": "Version of the middleware resource to use", "example": "latest" }, "type": { "type": "string", "description": "When the middleware should execute", "example": "pre-request", "enum": [ "pre-request", "post-request" ] } } }, "Metadata": { "type": "object", "properties": { "subject": { "type": "string", "description": "Subject identifier for the resource", "example": "ms.gateway.abcdef123456.gateway" } } }, "GatewayCreateRequest": { "type": "object", "required": [ "name", "active" ], "properties": { "name": { "type": "string", "description": "Name of the gateway", "example": "My API Gateway" }, "description": { "type": "string", "description": "Description of the gateway", "example": "Gateway for my service APIs" }, "active": { "type": "boolean", "description": "Whether the gateway is active", "default": true, "example": true }, "middleware": { "type": "array", "description": "List of middleware to be applied to the gateway", "items": { "$ref": "#/components/schemas/Middleware" } }, "limit": { "$ref": "#/components/schemas/Limit" }, "timeout": { "type": "integer", "description": "Timeout in milliseconds for gateway requests", "default": 30000, "example": 30000 } } }, "GatewayUpdateRequest": { "type": "object", "properties": { "name": { "type": "string", "description": "Updated name of the gateway", "example": "Updated Gateway Name" }, "description": { "type": "string", "description": "Updated description of the gateway", "example": "Updated description for my gateway" }, "active": { "type": "boolean", "description": "Whether the gateway is active", "example": true }, "middleware": { "type": "array", "description": "Updated list of middleware to be applied to the gateway", "items": { "$ref": "#/components/schemas/Middleware" } }, "limit": { "$ref": "#/components/schemas/Limit" }, "timeout": { "type": "integer", "description": "Updated timeout in milliseconds for gateway requests", "example": 60000 } } }, "GatewayResponse": { "type": "object", "properties": { "name": { "type": "string", "description": "Name of the gateway", "example": "My API Gateway" }, "description": { "type": "string", "description": "Description of the gateway", "example": "Gateway for my service APIs" }, "url": { "type": "string", "description": "URL of the gateway", "example": "https://abc123.quiva.ai" }, "subject": { "type": "string", "description": "Subject identifier of the gateway", "example": "ms.gateway.abcdef123456.gateway" }, "active": { "type": "boolean", "description": "Whether the gateway is active", "example": true }, "timeout": { "type": "integer", "description": "Timeout in milliseconds for gateway requests", "example": 30000 }, "limit": { "$ref": "#/components/schemas/Limit" }, "middleware": { "type": "array", "description": "List of middleware applied to the gateway", "items": { "$ref": "#/components/schemas/Middleware" } }, "modified": { "type": "integer", "description": "Unix timestamp of when the gateway was last modified", "example": 1713531894 }, "type": { "type": "string", "description": "Type of the gateway record", "example": "created" } } }, "GatewayResponseWrapper": { "type": "object", "properties": { "body": { "$ref": "#/components/schemas/GatewayResponse" }, "metadata": { "$ref": "#/components/schemas/Metadata" } } }, "GatewayListResult": { "type": "object", "properties": { "results": { "type": "array", "description": "List of gateways", "items": { "$ref": "#/components/schemas/GatewayResponse" } }, "results_total": { "type": "integer", "description": "Total number of gateways returned", "example": 2 } } }, "GatewayListResponseWrapper": { "type": "object", "properties": { "body": { "$ref": "#/components/schemas/GatewayListResult" }, "metadata": { "$ref": "#/components/schemas/Metadata" } } }, "MappingCreateRequest": { "type": "object", "required": [ "path" ], "properties": { "path": { "type": "string", "description": "URL path for the mapping", "example": "/api/users" }, "method": { "type": "string", "description": "HTTP method for the mapping", "default": "POST", "enum": [ "GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD" ], "example": "GET" }, "is_public": { "type": "boolean", "description": "Whether the mapping is publicly accessible", "default": false, "example": true }, "limit": { "$ref": "#/components/schemas/Limit" }, "timeout": { "type": "integer", "description": "Timeout in milliseconds for mapping requests", "default": 30000, "example": 30000 }, "traffic_distribution": { "type": "object", "description": "Traffic distribution configuration for A/B testing", "additionalProperties": { "type": "integer" }, "example": { "1": 100 } } } }, "MappingUpdateRequest": { "type": "object", "properties": { "path": { "type": "string", "description": "Updated URL path for the mapping", "example": "/api/users/v2" }, "is_public": { "type": "boolean", "description": "Whether the mapping is publicly accessible", "example": false }, "limit": { "$ref": "#/components/schemas/Limit" }, "timeout": { "type": "integer", "description": "Updated timeout in milliseconds for mapping requests", "example": 60000 }, "traffic_distribution": { "type": "object", "description": "Updated traffic distribution configuration for A/B testing", "additionalProperties": { "type": "integer" }, "example": { "1": 80, "2": 20 } } } }, "MappingResponse": { "type": "object", "properties": { "subject": { "type": "string", "description": "Subject identifier of the mapping", "example": "ms.gateway.abcdef123456.mapping.get.api.users" }, "path": { "type": "string", "description": "URL path for the mapping", "example": "/api/users" }, "method": { "type": "string", "description": "HTTP method for the mapping", "example": "GET" }, "is_public": { "type": "boolean", "description": "Whether the mapping is publicly accessible", "example": true }, "limit": { "$ref": "#/components/schemas/Limit" }, "timeout": { "type": "integer", "description": "Timeout in milliseconds for mapping requests", "example": 30000 }, "traffic_distribution": { "type": "object", "description": "Traffic distribution configuration for A/B testing", "additionalProperties": { "type": "integer" }, "example": { "1": 100 } }, "modified": { "type": "integer", "description": "Unix timestamp of when the mapping was last modified", "example": 1713531894 }, "type": { "type": "string", "description": "Type of the mapping record", "example": "created" } } }, "MappingResponseWrapper": { "type": "object", "properties": { "body": { "$ref": "#/components/schemas/MappingResponse" }, "metadata": { "$ref": "#/components/schemas/Metadata" } } }, "MappingListResult": { "type": "object", "properties": { "results": { "type": "array", "description": "List of mappings", "items": { "$ref": "#/components/schemas/MappingResponse" } }, "results_total": { "type": "integer", "description": "Total number of mappings returned", "example": 2 } } }, "MappingListResponseWrapper": { "type": "object", "properties": { "body": { "$ref": "#/components/schemas/MappingListResult" }, "metadata": { "$ref": "#/components/schemas/Metadata" } } }, "MappingVersionCreateRequest": { "type": "object", "required": [ "resource_type", "resource" ], "properties": { "resource_type": { "type": "string", "description": "Type of resource that will handle requests", "example": "function" }, "resource": { "type": "string", "description": "Resource identifier that will handle requests", "example": "user-service.getUsers" }, "resource_version": { "type": "string", "description": "Version of the resource", "default": "latest", "example": "latest" }, "active": { "type": "boolean", "description": "Whether the mapping version is active", "default": true, "example": true }, "description": { "type": "string", "description": "Description of the mapping version", "example": "Gets all users with pagination" }, "middleware": { "type": "array", "description": "List of middleware to be applied to the mapping version", "items": { "$ref": "#/components/schemas/Middleware" } }, "exact_match": { "type": "boolean", "description": "Whether the path should be matched exactly", "default": false, "example": false }, "attributes": { "type": "array", "description": "Attributes for the mapping version", "items": { "type": "string" }, "example": [] }, "boolean_logic": { "type": "string", "description": "Boolean logic expression for request routing", "example": "" }, "invocation_type": { "type": "string", "description": "Type of invocation for the resource", "example": "RequestResponse" } } }, "MappingVersionUpdateRequest": { "type": "object", "properties": { "active": { "type": "boolean", "description": "Whether the mapping version is active", "example": false }, "description": { "type": "string", "description": "Updated description of the mapping version", "example": "Updated description for version 1" }, "middleware": { "type": "array", "description": "Updated list of middleware to be applied to the mapping version", "items": { "$ref": "#/components/schemas/Middleware" } }, "exact_match": { "type": "boolean", "description": "Whether the path should be matched exactly", "example": true }, "attributes": { "type": "array", "description": "Updated attributes for the mapping version", "items": { "type": "string" }, "example": [ "premium" ] }, "boolean_logic": { "type": "string", "description": "Updated boolean logic expression for request routing", "example": "user.premium == true" }, "invocation_type": { "type": "string", "description": "Updated type of invocation for the resource", "example": "Event" } } }, "MappingVersionResponse": { "type": "object", "properties": { "subject": { "type": "string", "description": "Subject identifier of the mapping version", "example": "ms.gateway.abcdef123456.mapping-version.get.api.users.1" }, "resource_type": { "type": "string", "description": "Type of resource that handles requests", "example": "function" }, "resource": { "type": "string", "description": "Resource identifier that handles requests", "example": "user-service.getUsers" }, "resource_version": { "type": "string", "description": "Version of the resource", "example": "latest" }, "active": { "type": "boolean", "description": "Whether the mapping version is active", "example": true }, "description": { "type": "string", "description": "Description of the mapping version", "example": "Gets all users with pagination" }, "middleware": { "type": "array", "description": "List of middleware applied to the mapping version", "items": { "$ref": "#/components/schemas/Middleware" } }, "exact_match": { "type": "boolean", "description": "Whether the path is matched exactly", "example": false }, "attributes": { "type": "array", "description": "Attributes for the mapping version", "items": { "type": "string" }, "example": [] }, "boolean_logic": { "type": "string", "description": "Boolean logic expression for request routing", "example": "" }, "invocation_type": { "type": "string", "description": "Type of invocation for the resource", "example": "RequestResponse" }, "version": { "type": "integer", "description": "Version number", "example": 1 }, "modified": { "type": "integer", "description": "Unix timestamp of when the mapping version was last modified", "example": 1713531894 }, "type": { "type": "string", "description": "Type of the mapping version record", "example": "created" } } }, "MappingVersionResponseWrapper": { "type": "object", "properties": { "body": { "$ref": "#/components/schemas/MappingVersionResponse" }, "metadata": { "$ref": "#/components/schemas/Metadata" } } }, "MappingVersionListResult": { "type": "object", "properties": { "results": { "type": "array", "description": "List of mapping versions", "items": { "$ref": "#/components/schemas/MappingVersionResponse" } }, "results_total": { "type": "integer", "description": "Total number of mapping versions returned", "example": 2 } } }, "MappingVersionListResponseWrapper": { "type": "object", "properties": { "body": { "$ref": "#/components/schemas/MappingVersionListResult" }, "metadata": { "$ref": "#/components/schemas/Metadata" } } }, "SuccessResponse": { "type": "object", "properties": { "message": { "type": "string", "example": "success" } } } }, "responses": { "BadRequest": { "description": "Bad request", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Invalid request parameters" } } } } } }, "NotFound": { "description": "Resource not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "The requested resource does not exist" } } } } } } } } }