Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Choice" validation settings example is incorrect. #2085

Open
edhgoose opened this issue Jun 15, 2024 · 1 comment
Open

"Choice" validation settings example is incorrect. #2085

edhgoose opened this issue Jun 15, 2024 · 1 comment
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@edhgoose
Copy link

edhgoose commented Jun 15, 2024

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:

CleanShot 2024-06-15 at 15 29 59@2x

Steps to reproduce the behavior:

  1. Add the config above to a setting
  2. Observe that the CLI complains
  3. Replace the " with \" and see it works and the UI renders.

Expected behavior

No error and correct documentation.

Screenshots

Additional context

@edhgoose edhgoose added the bug Something isn't working label Jun 15, 2024
@jun-shop jun-shop added the documentation Improvements or additions to documentation label Jun 17, 2024
@edhgoose
Copy link
Author

As requested in #2521, I have re-raised this issue as: https://community.shopify.dev/t/bug-choice-validation-settings-example-is-incorrect/6409

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants