How to join multiple parts of one data container

Michal Švamberg <[email protected]> Wed, 26 Jul 2023 14:42:42 +0200
Newsgroups gmane.comp.sysutils.cfengine.general
Message-ID <CAFgL0Wg0x_OSpT=edWaDwmHajCjbjoL-mCoN4W6n2mz67kPvWQ@mail.gmail.com>
Hi all,
I have big data container (more than 4K) with all debian repository, as
this:
<pre>
{
  "debian_10": {
    "debian": {
      "Components": "main contrib non-free",
      "Suites": [
        "buster",
        "buster-backports"
      ],
      "URIs": "http://deb.debian.org/debian"
    },
    "debian-security": {
      "Components": "main contrib non-free",
      "Suites": [
...
</pre>

I want shorting this data to server, this is running perfect:
"myrepos" data => '[ repos[debian_12] ,  repos[debian_11] ]';

But when i need more specific repository
"myrepos" data => '[ repos[debian_10][debian] ,
 repos[debian_10][debian-security] ]'
I get this error:
error: Error parsing JSON expression '[debian] ,
 repos[debian_10][debian-security] ]': Unable to parse json data as array,
did not start with '['

How can I access the second levels of the data container and serialize them?

Thanks.
Michal Svamberg

-- 
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/help-cfengine/CAFgL0Wg0x_OSpT%3DedWaDwmHajCjbjoL-mCoN4W6n2mz67kPvWQ%40mail.gmail.com.