In the "Downsides" section for CLI it states: "No support for nested fields",
however I DO can pass nested fields from the CLI --env parameter by using JSON string values:
The cypress docs for --env param shows the use of JSON parameters.
And tested by me in Cypress v13.6.3, example from package.json scripts:
"cy:open": "cypress open --env \"{\\\"conf1\\\":\\\"val 1,2\\\", \\\"nested\\\":{\\\"subProp\\\":true}}\"",
or as a simple command:
cypress open --env '{"conf1":"val 1,2", "nested": { "subProp": true } }'
Also by using JSON I can pass special characters within string values like single/double quotes and spaces.
Should the guide be updated to document the JSON values and state that nested fields are supported?
Subject
Guides
Description
In this guide: https://docs.cypress.io/guides/guides/environment-variables#Option-4---env
In the "Downsides" section for CLI it states: "No support for nested fields", however I DO can pass nested fields from the CLI --env parameter by using JSON string values:
The cypress docs for
--env
param shows the use of JSON parameters.And tested by me in Cypress v13.6.3, example from package.json scripts:
or as a simple command:
cypress open --env '{"conf1":"val 1,2", "nested": { "subProp": true } }'
Also by using JSON I can pass special characters within string values like single/double quotes and spaces.
Should the guide be updated to document the JSON values and state that nested fields are supported?