Extend mender-configure to dictionarys and arrays instead of simple key-value pairs

Does somebody know if it is somehow possible (or planned) to have dictionaries or arrays as value in the configuration JSON?

From my point of view, the whole process and backend should be able to support it, because as long as a valid JSON is used, the uploaded configuration JSON file just gets deployed to the device and there it is processed by a script.

The only problem is the current UI, which is not capable of displaying objects (dicts or arrays) in the value-field. Also it is not possible to enter a dict {“dictKey”: “dictValue”} or an array [1, 2, 3] in the UI as value-field.

You are right, it’s only the UI which doesn’t support it. You can submit whatever JSON you want using the backend API. Support for a free form editor in the UI is in the planning stage, but I can’t give an exact timeline for when/if it will be available.

Update: Sorry, I’m wrong actually. The backend checks that each value is a string, so this is a limitation currently. The planning part is correct though, we are thinking about improving this.

1 Like

Thank you for the quick answer.

Yes, i saw that there are also some checks in the backend when uploading new configs via API. I meant principally, from the backend side, it would be possible, because the whole file is deployed. But there are some bigger changes necessary in the frontend.

Are you able to give a little more information on the planning? Like in the next 2 months or not before 2022? Because based on this we need to decide if we want to create a workaround in our pipleine and on the devices or just wait for the feature :slight_smile:

Unlikely before 2022. Fixing this is actually more of a side effect of implementing a different, bigger feature. So I’d stick to the workaround for now!

The simplest workaround is just to put a new JSON string inside a string value of the existing JSON, I suppose.