{"openapi":"3.0.1","info":{"title":"Order Events Service API","description":"REST API for creating orders and publishing order-created Kafka events.","version":"0.1.0"},"servers":[{"url":"http://localhost:8080","description":"Local development server"}],"tags":[{"name":"Orders","description":"Order creation API"}],"paths":{"/api/orders":{"post":{"tags":["Orders"],"summary":"Create an order","description":"Persists an order and publishes an OrderCreatedEvent to Kafka.","operationId":"createOrder","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderRequest"}}},"required":true},"responses":{"201":{"description":"Order created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponse"}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}}}}}},"components":{"schemas":{"CreateOrderRequest":{"required":["amount","customerId"],"type":"object","properties":{"customerId":{"maxLength":120,"minLength":0,"type":"string","description":"External customer identifier.","example":"customer-001"},"amount":{"minimum":0.01,"exclusiveMinimum":false,"type":"number","description":"Order amount. Must be greater than zero.","example":199.9}},"description":"Payload used to create an order and publish its creation event."},"OrderResponse":{"type":"object","properties":{"id":{"type":"string","description":"Service-generated order identifier.","format":"uuid"},"customerId":{"type":"string","description":"External customer identifier."},"amount":{"type":"number","description":"Order amount."},"status":{"type":"string","description":"Current order status.","enum":["CREATED"]},"createdAt":{"type":"string","description":"UTC timestamp captured when the order was created.","format":"date-time"}},"description":"Created order representation returned by the API."},"ProblemDetail":{"type":"object","properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer","format":"int32"},"detail":{"type":"string"},"instance":{"type":"string","format":"uri"},"properties":{"type":"object","additionalProperties":{"type":"object"}}}}}}}