-
-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: handle AsyncAPI v3 for diff command (#1596)
Co-authored-by: Ashish Padhy <[email protected]>
- Loading branch information
1 parent
75e17be
commit 8ae33c4
Showing
6 changed files
with
284 additions
and
37 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@asyncapi/cli": patch | ||
--- | ||
|
||
Handle AsyncAPI v3 in diff command |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,249 @@ | ||
asyncapi: 3.0.0 | ||
id: 'urn:example:com:smartylighting:streetlights:server' | ||
info: | ||
title: AsyncAPI App | ||
version: 1.0.1 | ||
description: This is a sample app. | ||
termsOfService: 'https://asyncapi.com/terms/' | ||
contact: | ||
name: API Support | ||
url: 'https://www.asyncapi.com/support' | ||
email: [email protected] | ||
license: | ||
name: Apache 2.0 | ||
url: 'https://www.apache.org/licenses/LICENSE-2.0.html' | ||
tags: | ||
- name: e-commerce | ||
- name: another-tag | ||
description: Description... | ||
externalDocs: | ||
description: Find more info here | ||
url: 'https://www.asyncapi.com' | ||
defaultContentType: application/json | ||
servers: | ||
default: | ||
host: 'api.streetlights.smartylighting.com:{port}' | ||
protocol: mqtt | ||
description: Test broker | ||
variables: | ||
port: | ||
description: Secure connection (TLS) is available through port 8883. | ||
default: '8883' | ||
enum: | ||
- '1883' | ||
- '8883' | ||
security: | ||
- $ref: '#/components/securitySchemes/apiKey' | ||
- type: oauth2 | ||
flows: | ||
implicit: | ||
authorizationUrl: 'https://example.com/api/oauth/dialog' | ||
availableScopes: | ||
'write:pets': modify pets in your account | ||
'read:pets': read your pets | ||
scopes: | ||
- 'write:pets' | ||
- type: openIdConnect | ||
openIdConnectUrl: https://example.com/api | ||
scopes: | ||
- 'some:scope:1' | ||
- 'some:scope:2' | ||
production: | ||
host: 'api.streetlights.smartylighting.com:{port}' | ||
pathname: /some/path-name | ||
protocol: mqtt | ||
description: Test broker | ||
variables: | ||
port: | ||
description: Secure connection (TLS) is available through port 8883. | ||
default: '1883' | ||
enum: | ||
- '1883' | ||
- '8883' | ||
security: | ||
- $ref: '#/components/securitySchemes/apiKey' | ||
withProtocol: | ||
host: 'api.streetlights.smartylighting.com:{port}' | ||
pathname: /some/path | ||
protocol: mqtt | ||
description: Test broker | ||
variables: | ||
port: | ||
description: Secure connection (TLS) is available through port 8883. | ||
default: '1883' | ||
enum: | ||
- '1883' | ||
- '8883' | ||
security: | ||
- $ref: '#/components/securitySchemes/apiKey' | ||
channels: | ||
'lightingMeasured': | ||
address: 'smartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured' | ||
messages: | ||
lightMeasured: | ||
payload: | ||
type: object | ||
servers: | ||
- $ref: '#/servers/production' | ||
parameters: | ||
streetlightId: | ||
$ref: '#/components/parameters/streetlightId' | ||
'turnOn': | ||
address: 'smartylighting/streetlights/1/0/action/{streetlightId}/turn/on' | ||
messages: | ||
lightMeasured: | ||
$ref: '#/components/messages/lightMeasured' | ||
subscribe.message.0: | ||
$ref: '#/components/messages/turnOnOff' | ||
customMessageId: | ||
payload: | ||
type: object | ||
subscribe.message.2: | ||
payload: | ||
type: object | ||
servers: | ||
- $ref: '#/servers/default' | ||
- $ref: '#/servers/production' | ||
parameters: | ||
streetlightId: | ||
$ref: '#/components/parameters/streetlightId' | ||
customChannelId: | ||
address: 'smartylighting/streetlights/1/0/action/{streetlightId}/turn/off' | ||
messages: | ||
turnOnOff: | ||
$ref: '#/components/messages/turnOnOff' | ||
parameters: | ||
streetlightId: | ||
$ref: '#/components/parameters/streetlightId' | ||
x-channelId: customChannelId | ||
'dim': | ||
address: 'smartylighting/streetlights/1/0/action/{streetlightId}/dim' | ||
messages: | ||
dimLight: | ||
$ref: '#/components/messages/dimLight' | ||
parameters: | ||
streetlightId: | ||
$ref: '#/components/parameters/streetlightId' | ||
operations: | ||
receiveLightMeasured: | ||
action: receive | ||
channel: | ||
$ref: '#/channels/lightingMeasured' | ||
messages: | ||
- $ref: '#/channels/lightingMeasured/messages/lightMeasured' | ||
'receiveTurnOn': | ||
action: receive | ||
channel: | ||
$ref: '#/channels/turnOn' | ||
messages: | ||
- $ref: '#/channels/turnOn/messages/lightMeasured' | ||
'smartylighting/streetlights/1/0/action/{streetlightId}/turn/on.subscribe': | ||
action: send | ||
channel: | ||
$ref: '#/channels/turnOn' | ||
messages: | ||
- $ref: '#/channels/turnOn/messages/customMessageId' | ||
- $ref: '#/channels/turnOn/messages/subscribe.message.2' | ||
turnOnOff: | ||
action: send | ||
channel: | ||
$ref: '#/channels/customChannelId' | ||
messages: | ||
- $ref: '#/channels/customChannelId/messages/turnOnOff' | ||
dimLight: | ||
action: send | ||
channel: | ||
$ref: '#/channels/dim' | ||
security: | ||
- type: oauth2 | ||
flows: | ||
implicit: | ||
authorizationUrl: 'https://example.com/api/oauth/dialog' | ||
availableScopes: | ||
'write:pets': modify pets in your account | ||
'read:pets': read your pets | ||
scopes: | ||
- 'write:pets' | ||
messages: | ||
- $ref: '#/channels/dim/messages/dimLight' | ||
components: | ||
messages: | ||
lightMeasured: | ||
summary: >- | ||
Inform about environmental lighting conditions for a particular | ||
streetlight. | ||
payload: | ||
$ref: '#/components/schemas/lightMeasuredPayload' | ||
turnOnOff: | ||
summary: Command a particular streetlight to turn the lights on or off. | ||
payload: | ||
$ref: '#/components/schemas/turnOnOffPayload' | ||
dimLight: | ||
summary: Command a particular streetlight to dim the lights. | ||
payload: | ||
$ref: '#/components/schemas/dimLightPayload' | ||
schemas: | ||
lightMeasuredPayload: | ||
type: object | ||
properties: | ||
lumens: | ||
type: integer | ||
minimum: 0 | ||
description: Light intensity measured in lumens. | ||
sentAt: | ||
$ref: '#/components/schemas/sentAt' | ||
turnOnOffPayload: | ||
type: object | ||
properties: | ||
command: | ||
type: string | ||
enum: | ||
- 'on' | ||
- 'off' | ||
description: Whether to turn on or off the light. | ||
sentAt: | ||
$ref: '#/components/schemas/sentAt' | ||
dimLightPayload: | ||
type: object | ||
properties: | ||
percentage: | ||
type: integer | ||
description: Percentage to which the light should be dimmed to. | ||
minimum: 0 | ||
maximum: 100 | ||
sentAt: | ||
$ref: '#/components/schemas/sentAt' | ||
sentAt: | ||
type: string | ||
format: date-time | ||
description: Date and time when the message was sent. | ||
securitySchemes: | ||
apiKey: | ||
type: apiKey | ||
in: user | ||
description: Provide your API key as the user and leave the password empty. | ||
flows: | ||
type: oauth2 | ||
flows: | ||
implicit: | ||
authorizationUrl: 'https://example.com/api/oauth/dialog' | ||
availableScopes: | ||
'write:pets': modify pets in your account | ||
'read:pets': read your pets | ||
openIdConnect: | ||
type: openIdConnect | ||
openIdConnectUrl: https://example.com/api | ||
scopes: | ||
- 'some:scope:1' | ||
- 'some:scope:2' | ||
unusedFlows: | ||
type: oauth2 | ||
flows: | ||
implicit: | ||
authorizationUrl: 'https://example.com/api/oauth/dialog' | ||
availableScopes: | ||
'write:pets': modify pets in your account | ||
'read:pets': read your pets | ||
parameters: | ||
streetlightId: | ||
description: The ID of the streetlight. |
Oops, something went wrong.