mesg-foundation / js-sdk

Javascript mono-repo with all the tools to interact with MESG
https://mesg.com
4 stars 4 forks source link

service:compile don't give stable output for empty arrays #133

Closed krhubert closed 4 years ago

krhubert commented 4 years ago

Compilation sometimes puts empty arrays ([]) and sometimes skip keys at all.

For example keys like inputs, outputs, object, data, dependencies are always put into output json with an empty array, while keys like voluemes, volumesFrom, args etc.. are skipped.

Compilation should be predictable and stable. My proposal is to remove [] from json outputs, as I think, empty arrays are also removed by amino codec. The second option is to put [] everywhere, but this should be consistent.

{
  "sid": "test-service",
  "name": "test-service",
  "configuration": {
    "env": [
      "FOO=1",
      "BAR=2",
      "REQUIRED"
    ]
  },
  "dependencies": [],
  "tasks": [
    {
      "key": "ping",
      "inputs": [
        {
          "key": "msg",
          "type": "String",
          "object": []
        }
      ],
    }
  ]
}
antho1404 commented 4 years ago

Issue migrated to liteflow-labs/liteflow-js#24