As requested in [IMPORTANT] Stop creating issues here, use the Shopify Community forum instead · Issue #2521 · Shopify/ui-extensions · GitHub, I am re-raising this issue.
Please find below the details of "Choice" validation settings example is incorrect. · Issue #2085 · Shopify/ui-extensions · GitHub
Describe the bug
The documentation on this page says:
[[extensions.settings.fields.validations]]
name = "choices"
value = "["red", "green", "blue"]"
is a valid example.
But, the shopify cli will throw out an error:
15:26:16 │ app-access │ Error while deploying updated extension draft: Fix the following error in
extensions/order-status-ui/shopify.extension.toml:
15:26:16 │ app-access │ Unexpected character, expected only whitespace or comments till end of
line at row 65, col 12, pos 2186:
15:26:16 │ app-access │ 64: name = "choices"
15:26:16 │ app-access │ 65> value = "["red", "green", "blue"]"
Replacing the code with:
[[extensions.settings.fields.validations]]
name = "choices"
value = "[\"red\", \"green"\, \"blue\"]"
allows the UI to work:
Steps to reproduce the behavior:
- Add the config above to a setting
- Observe that the CLI complains
- Replace the
"
with\"
and see it works and the UI renders.
Expected behavior
No error and correct documentation.