Replies: 3 comments 4 replies
-
|
With REST are you thinking of perhaps Swagger / OpenAPI https://swagger.io/docs/specification/v3_0/about/ ? |
Beta Was this translation helpful? Give feedback.
-
|
The JSON streaming interface uses JSONPath-like syntax (e.g. |
Beta Was this translation helpful? Give feedback.
-
|
(sorry for the delay) no, I do not use jsonpath anywhere - as said, I use sparse json documents for updates (I have a streaming endpoint for two of my databases and currently config updates are just sent this way by the front end) Let me understand the pointer logic - I would basically be able to create a pointer from a String (such as I understand the challenge of datatypes here, but at least for my use case, strings would be okay as the data would be serialized to send over network protocols anyway, having the streaming interface in parallel would be helpful to limit heap usage. As said, the idea is to basically be able to map the internal structure (which is hopefully a logical representation of the data the application is working with) to a set of similarly structured external interfaces. In fact, I like the idea to have external routing functions that map subtrees from the html or mqtt or any other request to the corresponding database paths. That would be helpful to build multiple access methods but keep the structure in the backend same and minimize the amount of translation / database access code. At this point, I have two legacy APIs that use json rpc over http and mqtt, and I will probably want to keep json rpc for websocket, but since most home automation systems have moved to a state based mqtt, that seems to be the way to go. So in the end, I guess what I'm envisioning would make ConfigDB the central marshaller for all settings and information and there would be routers for the different access protocols around it, providing the widest set of APIs. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
so, the new conditional defaults are great, that can remove, in my case, a bit of application code and push decisions to the compile phase.
In general, ConfigDB has come a very long way from my initial idea of "how can I get rid of those in-memory configuration structs and their multiple conversion into json for the API and storage" to something that is "just there" and makes my code much cleaner.
I have found myself wondering a few times what more it could do, and please just take this as just that: a few thougths.
This would essentially turn any application that uses this into a reactive / event driven application not dissimilar to how we write GUI applications.
Taken to the extreme: the same system could be used to describe a UI - after all, ui elements usually also have state and something that creates an input or wants to be displayed. Sure, this is way beyond the scope of ConfigDB but - it seems like a possible extension of the concept.
Thinking about this I was wondering: would I really prefer describing all this in a json schema instead of in code, but the real question is: how much effort is it to keep code, UI and API in sync? Having a single place that provides an abstract data structure and auto-generate the access semantics does sount like something that would create a lot of functionality with very little code.
Beta Was this translation helpful? Give feedback.
All reactions