Created
November 4, 2022 12:19
-
-
Save mikaelvesavuori/25c68c5733fafd2e71e0eeb217c99821 to your computer and use it in GitHub Desktop.
AsyncAPI demo for GreetService
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "asyncapi": "2.4.0", | |
| "info": { | |
| "title": "Greet Service", | |
| "version": "1.0.0", | |
| "contact": { | |
| "name": "John Doe", | |
| "url": "https://acmecorp.com/docs#owner", | |
| "email": "[email protected]" | |
| }, | |
| "description": "The Greet Service takes care of being nice to our users." | |
| }, | |
| "externalDocs": { | |
| "description": "Confluence documentation", | |
| "url": "https://acmecorp.com/GreetService/docs" | |
| }, | |
| "servers": { | |
| "test": { | |
| "url": "https://api-test.acmecorp.com/", | |
| "protocol": "http", | |
| "description": "The test and dev endpoint." | |
| }, | |
| "production": { | |
| "url": "https://api.acmecorp.com/", | |
| "protocol": "http", | |
| "description": "Production endpoint." | |
| }, | |
| "bus": { | |
| "url": "arn:aws:events:eu-north-1:123412341234:event-bus/greet", | |
| "protocol": "eventbridge", | |
| "description": "The EventBridge bus to which events will be emitted." | |
| } | |
| }, | |
| "channels": { | |
| "Greet": { | |
| "publish": { | |
| "bindings": { | |
| "http": { | |
| "type": "request", | |
| "method": "POST" | |
| } | |
| }, | |
| "message": { | |
| "$ref": "#/components/messages/Greet" | |
| } | |
| } | |
| }, | |
| "GreetEvent": { | |
| "subscribe": { | |
| "operationId": "greet", | |
| "message": { | |
| "$ref": "#/components/messages/GreetEvent" | |
| } | |
| } | |
| } | |
| }, | |
| "components": { | |
| "messages": { | |
| "Greet": { | |
| "name": "Greet", | |
| "title": "Greet a user.", | |
| "summary": "Returns a randomized greeting phrase for the user.", | |
| "contentType": "application/json", | |
| "payload": { | |
| "$ref": "#/components/schemas/GreetInput" | |
| } | |
| }, | |
| "GreetEvent": { | |
| "name": "GreetEvent", | |
| "title": "Log that a user was greeted.", | |
| "summary": "Logs out the user that has been greeted for auditing purposes.", | |
| "payload": { | |
| "$ref": "#/components/schemas/GreetEventOutput" | |
| } | |
| } | |
| }, | |
| "schemas": { | |
| "GreetInput": { | |
| "type": "object", | |
| "description": "Greet user name by ID.", | |
| "properties": { | |
| "id": { | |
| "type": "number", | |
| "minimum": 0, | |
| "maximum": 99, | |
| "description": "Customer's ID number" | |
| } | |
| }, | |
| "additionalProperties": false | |
| }, | |
| "GreetEventOutput": { | |
| "type": "object", | |
| "description": "GreetEvent wrapped in EventBridge `detail`.", | |
| "properties": { | |
| "detail": { | |
| "type": "object", | |
| "description": "EventBridge `detail` field.", | |
| "$ref": "#/components/schemas/EventBridgeStandardSchema" | |
| } | |
| } | |
| }, | |
| "EventBridgeStandardSchema": { | |
| "type": "object", | |
| "description": "Our EventBridge standard schema.", | |
| "additionalProperties": false, | |
| "properties": { | |
| "data": { | |
| "type": "object", | |
| "description": "The user-provided data.", | |
| "additionalProperties": true | |
| }, | |
| "metadata": { | |
| "type": "object", | |
| "description": "General metadata that is always provided.", | |
| "additionalProperties": true, | |
| "$ref": "#/components/schemas/EventBridgeMetadataSchema" | |
| } | |
| } | |
| }, | |
| "EventBridgeMetadataSchema": { | |
| "type": "object", | |
| "description": "Our EventBridge standard metadata schema.", | |
| "additionalProperties": false, | |
| "properties": { | |
| "id": { | |
| "type": "string", | |
| "description": "ID of the event." | |
| }, | |
| "correlationId": { | |
| "type": "string", | |
| "description": "Correlation ID for the function call." | |
| }, | |
| "timestamp": { | |
| "type": "string", | |
| "description": "Timestamp of this message in Unix epoch." | |
| }, | |
| "timestampRequest": { | |
| "type": "string", | |
| "description": "Timestamp of the call." | |
| }, | |
| "level": { | |
| "type": "string", | |
| "description": "Log level." | |
| }, | |
| "context": { | |
| "type": "object", | |
| "description": "Context object.", | |
| "additionalProperties": true | |
| }, | |
| "version": { | |
| "type": "number", | |
| "description": "The version of the logged service." | |
| }, | |
| "user": { | |
| "type": "string", | |
| "description": "The user in this context." | |
| }, | |
| "route": { | |
| "type": "string", | |
| "description": "The route that is responding. In EventBridge, this will be your detail type." | |
| }, | |
| "duration": { | |
| "type": "number", | |
| "description": "Duration of processing in milliseconds." | |
| }, | |
| "error": { | |
| "type": "boolean", | |
| "description": "Is this an error?" | |
| }, | |
| "httpStatusCode": { | |
| "type": "number", | |
| "description": "What HTTP status code does this represent?", | |
| "minimum": 100, | |
| "maximum": 599 | |
| }, | |
| "traceId": { | |
| "type": "string", | |
| "description": "Trace ID." | |
| }, | |
| "lifecycleStage": { | |
| "type": "string", | |
| "description": "Which lifecycle stage the logged service pertains to." | |
| }, | |
| "domain": { | |
| "type": "string", | |
| "description": "Domain of the producer system." | |
| }, | |
| "system": { | |
| "type": "string", | |
| "description": "System of the producer." | |
| }, | |
| "service": { | |
| "type": "string", | |
| "description": "Service of the producer." | |
| }, | |
| "team": { | |
| "type": "string", | |
| "description": "Team responsible for emitting this log." | |
| }, | |
| "eventType": { | |
| "type": "string", | |
| "description": "Type of event." | |
| }, | |
| "platform": { | |
| "type": "string", | |
| "description": "The host platform or infrastructure that runs the system." | |
| }, | |
| "owner": { | |
| "type": "string", | |
| "description": "The organization that owns this system." | |
| }, | |
| "region": { | |
| "type": "string", | |
| "description": "Which region is this system running in?" | |
| }, | |
| "jurisdiction": { | |
| "type": "string", | |
| "description": "What legal jurisdiction does this system fall into?" | |
| }, | |
| "tags": { | |
| "type": "string", | |
| "description": "Tags for the logged system." | |
| }, | |
| "dataSensitivity": { | |
| "type": "string", | |
| "description": "Data sensitivity classification for the contents of this log.", | |
| "oneOf": [ | |
| { | |
| "title": "public", | |
| "type": "string", | |
| "format": "DataSensitivity" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment