-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add resolution of
$ref
s in subdirectories (#181)
- Loading branch information
Showing
30 changed files
with
964 additions
and
139 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
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,21 @@ | ||
asyncapi: 3.0.0 | ||
info: | ||
title: Streetlights MQTT API | ||
version: 1.0.0 | ||
description: "The Smartylighting Streetlights API allows you to remotely manage the city lights.\n\n### Check out its awesome features:\n\n* Turn a specific streetlight on/off \U0001F303\n* Dim a specific streetlight \U0001F60E\n* Receive real-time information about environmental lighting conditions \U0001F4C8\n" | ||
license: | ||
name: Apache 2.0 | ||
url: 'https://www.apache.org/licenses/LICENSE-2.0' | ||
defaultContentType: application/json | ||
servers: | ||
production: | ||
host: 'test.mosquitto.org:{port}' | ||
protocol: mqtt | ||
description: Test broker | ||
variables: | ||
port: | ||
description: Secure connection (TLS) is available through port 8883. | ||
default: '1883' | ||
enum: | ||
- '1883' | ||
- '8883' |
46 changes: 46 additions & 0 deletions
46
example/example-with-nested-dirs/asyncapi/receive/lightingMeasured/README.md
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,46 @@ | ||
# Lighting Measured 1.0.0 documentation | ||
|
||
|
||
## Operations | ||
|
||
### RECEIVE `smartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured` Operation | ||
|
||
*Inform about environmental lighting conditions of a particular streetlight.* | ||
|
||
* Operation ID: `receiveLightMeasurement` | ||
|
||
The topic on which measured values may be produced and consumed. | ||
|
||
#### Parameters | ||
|
||
| Name | Type | Description | Value | Constraints | Notes | | ||
|---|---|---|---|---|---| | ||
| streetlightId | string | The ID of the streetlight. | - | - | **required** | | ||
|
||
|
||
#### Message Light measured `lightMeasured` | ||
|
||
*Inform about environmental lighting conditions of a particular streetlight.* | ||
|
||
* Message ID: `lightMeasured` | ||
* Content type: [application/json](https://www.iana.org/assignments/media-types/application/json) | ||
|
||
##### Payload | ||
|
||
| Name | Type | Description | Value | Constraints | Notes | | ||
|---|---|---|---|---|---| | ||
| (root) | object | - | - | - | **additional properties are allowed** | | ||
| lumens | integer | Light intensity measured in lumens. | - | >= 0 | - | | ||
| sentAt | string | Date and time when the message was sent. | - | format (`date-time`) | - | | ||
|
||
> Examples of payload _(generated)_ | ||
```json | ||
{ | ||
"lumens": 0, | ||
"sentAt": "2019-08-24T14:15:22Z" | ||
} | ||
``` | ||
|
||
|
||
|
35 changes: 35 additions & 0 deletions
35
example/example-with-nested-dirs/asyncapi/receive/lightingMeasured/asyncapi.yaml
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,35 @@ | ||
asyncapi: 3.0.0 | ||
info: | ||
title: Lighting Measured | ||
version: 1.0.0 | ||
channels: | ||
lightingMeasured: | ||
address: 'smartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured' | ||
messages: | ||
lightMeasured: | ||
$ref: '#/components/messages/lightMeasured' | ||
description: The topic on which measured values may be produced and consumed. | ||
parameters: | ||
streetlightId: | ||
description: The ID of the streetlight. | ||
operations: | ||
receiveLightMeasurement: | ||
action: receive | ||
channel: | ||
$ref: '#/channels/lightingMeasured' | ||
summary: >- | ||
Inform about environmental lighting conditions of a particular | ||
streetlight. | ||
messages: | ||
- $ref: '#/channels/lightingMeasured/messages/lightMeasured' | ||
components: | ||
messages: | ||
lightMeasured: | ||
name: lightMeasured | ||
title: Light measured | ||
summary: >- | ||
Inform about environmental lighting conditions of a particular | ||
streetlight. | ||
contentType: application/json | ||
payload: | ||
$ref: ./schema.json |
16 changes: 16 additions & 0 deletions
16
example/example-with-nested-dirs/asyncapi/receive/lightingMeasured/schema.json
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,16 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"type": "object", | ||
"properties": { | ||
"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." | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
example/example-with-nested-dirs/asyncapi/send/lightTurnOff/README.md
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,32 @@ | ||
# Light Turn Off 1.0.0 documentation | ||
|
||
|
||
## Operations | ||
|
||
### SEND `smartylighting/streetlights/1/0/action/{streetlightId}/turn/off` Operation | ||
|
||
* Operation ID: `turnOff` | ||
|
||
#### Message Turn on/off `turnOnOff` | ||
|
||
*Command a particular streetlight to turn the lights on or off.* | ||
|
||
##### Payload | ||
|
||
| Name | Type | Description | Value | Constraints | Notes | | ||
|---|---|---|---|---|---| | ||
| (root) | object | - | - | - | **additional properties are allowed** | | ||
| command | string | Whether to turn on or off the light. | allowed (`"on"`, `"off"`) | - | - | | ||
| sentAt | string | Date and time when the message was sent. | - | format (`date-time`) | - | | ||
|
||
> Examples of payload _(generated)_ | ||
```json | ||
{ | ||
"command": "on", | ||
"sentAt": "2019-08-24T14:15:22Z" | ||
} | ||
``` | ||
|
||
|
||
|
25 changes: 25 additions & 0 deletions
25
example/example-with-nested-dirs/asyncapi/send/lightTurnOff/asyncapi.yaml
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,25 @@ | ||
asyncapi: 3.0.0 | ||
info: | ||
title: Light Turn Off | ||
version: 1.0.0 | ||
channels: | ||
lightTurnOff: | ||
address: 'smartylighting/streetlights/1/0/action/{streetlightId}/turn/off' | ||
messages: | ||
turnOff: | ||
$ref: '#/components/messages/turnOnOff' | ||
operations: | ||
turnOff: | ||
action: send | ||
channel: | ||
$ref: '#/channels/lightTurnOff' | ||
messages: | ||
- $ref: '#/channels/lightTurnOff/messages/turnOff' | ||
components: | ||
messages: | ||
turnOnOff: | ||
name: turnOnOff | ||
title: Turn on/off | ||
summary: Command a particular streetlight to turn the lights on or off. | ||
payload: | ||
$ref: ./schema.json |
20 changes: 20 additions & 0 deletions
20
example/example-with-nested-dirs/asyncapi/send/lightTurnOff/schema.json
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,20 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"type": "object", | ||
"properties": { | ||
"command": { | ||
"type": "string", | ||
"enum": [ | ||
"on", | ||
"off" | ||
], | ||
"description": "Whether to turn on or off the light." | ||
}, | ||
"sentAt": { | ||
"type": "string", | ||
"format": "date-time", | ||
"description": "Date and time when the message was sent." | ||
} | ||
} | ||
} | ||
|
32 changes: 32 additions & 0 deletions
32
example/example-with-nested-dirs/asyncapi/send/lightTurnOn/README.md
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,32 @@ | ||
# Light Turn On 1.0.0 documentation | ||
|
||
|
||
## Operations | ||
|
||
### SEND `smartylighting/streetlights/1/0/action/{streetlightId}/turn/on` Operation | ||
|
||
* Operation ID: `turnOn` | ||
|
||
#### Message Turn on/off `turnOnOff` | ||
|
||
*Command a particular streetlight to turn the lights on or off.* | ||
|
||
##### Payload | ||
|
||
| Name | Type | Description | Value | Constraints | Notes | | ||
|---|---|---|---|---|---| | ||
| (root) | object | - | - | - | **additional properties are allowed** | | ||
| command | string | Whether to turn on or off the light. | allowed (`"on"`, `"off"`) | - | - | | ||
| sentAt | string | Date and time when the message was sent. | - | format (`date-time`) | - | | ||
|
||
> Examples of payload _(generated)_ | ||
```json | ||
{ | ||
"command": "on", | ||
"sentAt": "2019-08-24T14:15:22Z" | ||
} | ||
``` | ||
|
||
|
||
|
25 changes: 25 additions & 0 deletions
25
example/example-with-nested-dirs/asyncapi/send/lightTurnOn/asyncapi.yaml
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,25 @@ | ||
asyncapi: 3.0.0 | ||
info: | ||
title: Light Turn On | ||
version: 1.0.0 | ||
channels: | ||
lightTurnOn: | ||
address: 'smartylighting/streetlights/1/0/action/{streetlightId}/turn/on' | ||
messages: | ||
turnOn: | ||
$ref: '#/components/messages/turnOnOff' | ||
operations: | ||
turnOn: | ||
action: send | ||
channel: | ||
$ref: '#/channels/lightTurnOn' | ||
messages: | ||
- $ref: '#/channels/lightTurnOn/messages/turnOn' | ||
components: | ||
messages: | ||
turnOnOff: | ||
name: turnOnOff | ||
title: Turn on/off | ||
summary: Command a particular streetlight to turn the lights on or off. | ||
payload: | ||
$ref: ./schema.json |
19 changes: 19 additions & 0 deletions
19
example/example-with-nested-dirs/asyncapi/send/lightTurnOn/schema.json
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,19 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"type": "object", | ||
"properties": { | ||
"command": { | ||
"type": "string", | ||
"enum": [ | ||
"on", | ||
"off" | ||
], | ||
"description": "Whether to turn on or off the light." | ||
}, | ||
"sentAt": { | ||
"type": "string", | ||
"format": "date-time", | ||
"description": "Date and time when the message was sent." | ||
} | ||
} | ||
} |
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
Oops, something went wrong.