TBD54566975 / ftl

FTL - Towards a 𝝺-calculus for large-scale systems
https://tbd54566975.github.io/ftl/
Apache License 2.0
23 stars 7 forks source link

unclear what `--json` does when running `ftl config set` #3408

Open mistermoe opened 5 hours ago

mistermoe commented 5 hours ago

Repro

❯ ftl config set --json echo.default '{ "name": "beepboop"  }'
ftl: error: unknown: JSON validation failed: default has wrong type, expected String found map[string]interface {}
❯ ftl config set --json echo.default "{\"name\": \"beepboop\"}"
ftl: error: unknown: JSON validation failed: default has wrong type, expected String found map[string]interface {}
❯ ftl config set --db --json echo.default '"{\"name\": \"beepboop\"}"'

[!NOTE] Finally! But yuck

❯ ftl config get echo.default
"{\"name\": \"beepboop\"}"
❯ ftl config set --db echo.default '{"name": 3}'
❯ ftl config get echo.default
"{\"name\": 3}"
alecthomas commented 3 hours ago

The error is correct, but could perhaps be clearer... --json is for specifying strongly typed values, the FTL type is String and you're trying to put a map into it.