Skip to content

Instantly share code, notes, and snippets.

@AnishKacham
Created August 9, 2023 16:12
Show Gist options
  • Select an option

  • Save AnishKacham/f7cf6aadaa11c436d40f9910bef51a60 to your computer and use it in GitHub Desktop.

Select an option

Save AnishKacham/f7cf6aadaa11c436d40f9910bef51a60 to your computer and use it in GitHub Desktop.
Sample asyncapi spec document used in the docs on the website
asyncapi: '2.5.0'
info:
title: Streetlights API
version: '1.0.0'
description: |
The Smartylighting Streetlights API allows you
to remotely manage the city lights.
license:
name: Apache 2.0
url: 'https://www.apache.org/licenses/LICENSE-2.0'
servers:
mosquitto:
url: mqtt://test.mosquitto.org
protocol: mqtt
channels:
light/measured:
publish:
summary: Inform about environmental lighting conditions for a particular streetlight.
operationId: onLightMeasured
message:
name: LightMeasured
payload:
type: object
properties:
id:
type: integer
minimum: 0
description: Id of the streetlight.
lumens:
type: integer
minimum: 0
description: Light intensity measured in lumens.
sentAt:
type: string
format: date-time
description: Date and time when the message was sent.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment