-
Notifications
You must be signed in to change notification settings - Fork 156
Add AsyncAPI support #746
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add AsyncAPI support #746
Conversation
@naltatis Ich bin soweit durch. Du kannst gerne starten. Wenn du Fragen hast, immer her damit. Es sind 304 TODOs übrig, sorry für den kleinen Schock. |
@@ -0,0 +1,327 @@ | |||
package server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was macht diese Datei denn hier? Vmtl. zu Entwicklungszwecken rüberkopiert, oder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ja, das ist für Entwicklungszwecke, bin daran die Setter abgegangen. Die Datei sollte hier nicht sein.
Ich überlege immer noch ob wir die Daten nicht direkt aus der State Typescript Struktur + optionale JsDoc Annotation im Core Projekt erzeugen sollten. Vielleicht auch erst einmal ohne AsyncAPI Format sondern direkt als Markdown (oder leichtes JSON-Meta-Format) ähnlich wie die aktuelle Doku nur autogeneriert/-aktualisiert. Also aus einer Struktur wie dieser // types.ts
export interface State {
battery: Battery[];
/** @mqtt.action write */
batteryMode: BatteryMode;
...
}
interface Battery {
power: number;
capacity: number;
soc: number;
/** @description battery control supported */
controllable: boolean
}
... Dann so etwas generieren # MQTT Docs
- `/battery/<index>/power` number
- `/battery/<index>/capacity ` number
- `/battery/<index>/soc` number
- `/battery/<index>/controllable` battery control supported, boolean
- `/batteryMode` ["ModeA", "ModeB"], writable Natürlich wäre es cool, wenn wir Beschreibungstexte zu allen Werte hätten, wäre aber für einen ersten Wurf nicht zwingend erforderlich. Wir können auch noch mit Value-Types anstatt JS Primitiven Arbeiten (bspw. Hierfür müssten am Parser/Generator bauen, die dann das Markdown (oder ein JSON) erzeugen welches wird dann bei jedem Release vom Core Repo ins Docs Repo pushen. Bei den Templates machen wir das heute ja schon so ähnlich. Defacto bauen wir dann dort die Publish Logik von unserem Go Code nach. Aber die ändert sich weniger häufig als sich Felder verändern. |
Soetwas habe ich mir auch schon gedacht. Dann machen wir ertseinmal den Typescript Rewrite und dann das MQTT-API Thema. 👍 |
Fix #714
Fix #666
TODO:
Preview:
