You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The yaml spec supports strings with or without single or double quotes. The following are considered identical:
Sample String
"Sample String"
'Sample String'
EnvFile can read yaml files as environment definitions. When EnvFile does so, it assumes all values for keys will be string. This may not necessarily be the case. For example, a trivial application may have a config file:
foo: bar
bar: 42
EnvFile will be unable to parse this yaml because bar will resolve as an integer and a resulting ClassCastException will be thrown.
Note: This exception is insidious because if the IDE was attempting to execute a Run Configuration when this exception occurred, the associated Toolbar button in the JetBrains IDE will be greyed out until the IDE is restarted
The trivial application developer(s) could be required to specify a separate config file just for EnvFile to be able to parse:
foo: bar
bar: "42"
This yaml would be properly read by EnvFile and provide the foo and bar environment variables at runtime.
This feels like a less-optimal solution. It requires maintaining two nearly identical configuration files when one can (and arguably should) be sufficient. It seems reasonable that EnvFile properly read a yaml file and attempt a gentle coercion (if possible) by simply attempting String.valueOf on the parsed yaml values. This will yield the expected Map<String,String> for EnvFile to use.
The text was updated successfully, but these errors were encountered:
The yaml spec supports strings with or without single or double quotes. The following are considered identical:
EnvFile can read yaml files as
environment
definitions. When EnvFile does so, it assumes all values for keys will bestring
. This may not necessarily be the case. For example, a trivial application may have a config file:EnvFile will be unable to parse this yaml because
bar
will resolve as aninteger
and a resultingClassCastException
will be thrown.Note: This exception is insidious because if the IDE was attempting to execute a Run Configuration when this exception occurred, the associated Toolbar button in the JetBrains IDE will be greyed out until the IDE is restarted
The trivial application developer(s) could be required to specify a separate config file just for EnvFile to be able to parse:
This yaml would be properly read by EnvFile and provide the
foo
andbar
environment variables at runtime.This feels like a less-optimal solution. It requires maintaining two nearly identical configuration files when one can (and arguably should) be sufficient. It seems reasonable that EnvFile properly read a yaml file and attempt a gentle coercion (if possible) by simply attempting
String.valueOf
on the parsed yaml values. This will yield the expectedMap<String,String>
for EnvFile to use.The text was updated successfully, but these errors were encountered: