Include keys in components object in edge config
The id is a property of the model that is represented by each object, so including it in that representation is desirable. Same goes for the channels when included in the components.
This benefits (de)serialization in clients for the edge config api.
Hi there, the changes look ok to me.
Can you please elaborate a bit why this change is useful?
Do you plan any feature that depend on the ids?
Increasing the API surface should be done only after a discussion :)
Hi there,
Thanks for asking about our use-case and considering this PR.
The more specific and practical reason I'm using Kotlinx serialization library, with polymorphism based on content of the id's that we're using (relying on conventions). This content-based polymorphism works on exactly that: the content of the object, not its key.
A more generic argument In general, I think it is good practice to enclose all information about an entity (including its identity) in the object itself, not in both object + key. Since this is an extension of the API, I feel it should have low impact to existing use.
I decided to make these minor changes to our fork of OpenEMS, rather than work around the limitation.
Keen to hear your view on this.
@hydroid7 Would love to hear what you think. Keen to merge (or close) this PR.
Thanks @hydroid7. I'm not 100% sure what you are requesting. My understanding is that you would like:
- a larger PR (🤔 ?)
- additional documentation for
getEdgeConfigrpc
I hope to address both with 2 additional commits. Thanks.
Thank you for the docs, it looks good.
Hi @sfeilmeier I would like to finish this minor addition to the OpenEMS codebase. Hopefully you can give it the green light soon, expecially given it's a small change with low impact. Thanks for considering