Befor generating
This commit is contained in:
+24
-46
@@ -1,66 +1,44 @@
|
||||
# .venv/bin/asyncapi-python-codegen asyncapi.yaml out --force
|
||||
# asyncapi generate fromTemplate ./test/fixtures/asyncapi.yaml ./ -o ./out/project
|
||||
# kouknout na FastStream
|
||||
# https://nats.io/blog/nats-supported-by-faststream/#writing-app-code
|
||||
# https://github.com/asyncapi/python-paho-template
|
||||
# https://www.asyncapi.com/docs/tools/generator/generator-template
|
||||
|
||||
asyncapi: 3.0.0
|
||||
|
||||
info:
|
||||
title: Job Events
|
||||
title: Temperature Service
|
||||
version: 1.0.0
|
||||
description: This service is in charge of processing all the events related to temperature.
|
||||
|
||||
servers:
|
||||
nats_localhost:
|
||||
host: localhost:4222
|
||||
protocol: nats
|
||||
dev:
|
||||
host: test.mosquitto.org #in case you're using local mosquitto instance, change this value to localhost.
|
||||
protocol: mqtt
|
||||
|
||||
channels:
|
||||
run_test:
|
||||
address: mtr_test.run_test
|
||||
temperatureChanged:
|
||||
address: temperature/changed
|
||||
messages:
|
||||
run_test:
|
||||
$ref: '#/components/messages/mtr_request'
|
||||
return_uuid:
|
||||
address: null
|
||||
messages:
|
||||
run_test:
|
||||
$ref: '#/components/messages/mtr_uuid'
|
||||
temperatureChange:
|
||||
description: Message that is being sent when the temperature in the bedroom changes.
|
||||
payload:
|
||||
$ref: '#/components/schemas/temperatureId'
|
||||
description: Updates the bedroom temperature in the database when the temperatures drops or goes up.
|
||||
|
||||
operations:
|
||||
get_mtr_test:
|
||||
action: send
|
||||
temperatureChange:
|
||||
action: receive
|
||||
summary: Message sent to the broker when the temperature is changed.
|
||||
channel:
|
||||
$ref: '#/channels/run_test'
|
||||
reply:
|
||||
address:
|
||||
location: "$message.header#/replayTo"
|
||||
channel:
|
||||
$ref: '#/channels/return_uuid'
|
||||
$ref: '#/channels/temperatureChanged'
|
||||
|
||||
components:
|
||||
schemas:
|
||||
mtr_request_schema:
|
||||
payload:
|
||||
type: object
|
||||
properties:
|
||||
to_server:
|
||||
type: string
|
||||
mtr_sleep:
|
||||
type: integer
|
||||
mtr_uuid_schema:
|
||||
payload:
|
||||
type: object
|
||||
properties:
|
||||
uuid:
|
||||
type: string
|
||||
messages:
|
||||
mtr_request:
|
||||
name: mtr_request
|
||||
payload:
|
||||
type: object
|
||||
# required:
|
||||
# - to_server
|
||||
$ref: '#/components/schemas/mtr_request_schema'
|
||||
mtr_uuid:
|
||||
payload:
|
||||
$ref: '#/components/schemas/mtr_uuid_schema'
|
||||
temperatureId:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
properties:
|
||||
temperatureId:
|
||||
type: string
|
||||
Reference in New Issue
Block a user