From 2a115ab6f03aebffd0eb7728dc6be9fb36cf8e29 Mon Sep 17 00:00:00 2001 From: Fran Mendez Date: Mon, 23 Jan 2023 10:39:59 +0100 Subject: [PATCH] Improve examples --- spec/asyncapi.md | 49 ++++++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/spec/asyncapi.md b/spec/asyncapi.md index c2dfd573..545b9be1 100644 --- a/spec/asyncapi.md +++ b/spec/asyncapi.md @@ -467,18 +467,18 @@ An example of a server that has a `pathname`: ```json { - "host": "api.gemini.com", - "pathname": "/v2/marketdata", - "protocol": "wss", - "description": "Market data v2 is a public API that can stream all market and candle data across books. Market data v2 also supports multiple subscriptions in the same data feed." + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/production", + "protocol": "amqp", + "description": "Production RabbitMQ broker (uses the `production` vhost)." } ``` ```yaml -host: api.gemini.com -pathname: /v2/marketdata -protocol: wss -description: Market data v2 is a public API that can stream all market and candle data across books. Market data v2 also supports multiple subscriptions in the same data feed. +host: rabbitmq.in.mycompany.com:5672 +pathname: /production +protocol: amqp +description: Production RabbitMQ broker (uses the `production` vhost). ``` #### Server Variable Object @@ -500,28 +500,33 @@ This object MAY be extended with [Specification Extensions](#specificationExtens ```json { - "host": "api.gemini.com", - "pathname": "/v1/marketdata/{symbol}", - "protocol": "wss", - "description": "Market data is a public API that streams all the market data on a given symbol.", - "title": "Market Data API v1", + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/{env}", + "protocol": "amqp", + "description": "RabbitMQ broker. Use the `env` variable to point to either `production` or `staging`.", "variables": { - "symbol": { - "description": "Symbols are formatted as `CCY1CCY2` where prices are in `CCY2` and quantities are in `CCY1`." + "env": { + "description": "Environment to connect to. It can be either `production` or `staging`.", + "enum": [ + "production", + "staging" + ] } } } ``` ```yaml -host: 'api.gemini.com' -pathname: '/v1/marketdata/{symbol}' -protocol: wss -description: Market data is a public API that streams all the market data on a given symbol. -title: Market Data API v1 +host: 'rabbitmq.in.mycompany.com:5672' +pathname: '/{env}' +protocol: amqp +description: RabbitMQ broker. Use the `env` variable to point to either `production` or `staging`. variables: - symbol: - description: Symbols are formatted as `CCY1CCY2` where prices are in `CCY2` and quantities are in `CCY1`. + env: + description: Environment to connect to. It can be either `production` or `staging`. + enum: + - production + - staging ```