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

Environment variable expansion in string context triggers JSON parser #132

Closed
adriansr opened this issue Aug 9, 2019 · 1 comment
Closed
Assignees
Labels

Comments

@adriansr
Copy link

adriansr commented Aug 9, 2019

When an environment variable is expanded inside a string:

field: "${MY_VAR}"

The parser will in turn try to parse the variable contents as if they were JSON values. For example when MY_VAR is {user}, the parser will complain that the input is malformed:

expected ':' when parsing '{user' accessing 'field'

which doesn't happen when the same value is hardcoded:

field "{user}"

parses correctly.

@adriansr adriansr added the bug label Aug 9, 2019
@blakerouse blakerouse self-assigned this Jan 16, 2020
@zube zube bot unassigned blakerouse Jan 16, 2020
@blakerouse blakerouse self-assigned this Jan 16, 2020
blakerouse added a commit that referenced this issue Jan 17, 2020
…139)

* Fix parsing of environment variables to prevent object parsing. #132

* Add validation of config to prevent Object true and Array false. Add more tests.

* Move parse from interal to importable module. Rename ParseConfig to just Config, so import is parse.Config. Add parse.Config to return of resolvers.

* Add test for parse config validation.

* Add changelog entry.
@blakerouse
Copy link
Contributor

Fixed in #139

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants