Enable parsing of JSON env vars #2849
Open
+83
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Modifies how environment variables are parsed to avoid JSON parsing errors.
Currently, variable parsing calls
show value
, but the show function in Haskell automatically adds quotes around strings and escapes internal quotes. So when you have:it gets converted to:
The value that gets passed to
JSON.parse()
includes the outer quotes and escaped inner quotes, which is why it fails.Fixes #2846
Select what type of change this PR introduces:
Update Waspc ChangeLog and version if needed
If you did a bug fix, new feature, or breaking change, that affects
waspc
, make sure you satisfy the following:ChangeLog.md
with description of the change this PR introduces.waspc
version inwaspc.cabal
to reflect changes I introduced, with regards to the version of the latest wasp release, if the bump was needed.Add a regression test if needed
If you did a bug fix, make sure you satisfy the following:
If you're unable to add a regression test, please explain why.
This likely indicates that our current testing setup needs improvement.
Update example apps if needed
If you did code changes and added a new feature, make sure you satisfy the following:
waspc/examples/todoApp
and its e2e tests as needed and manually checked it works correctly.If you did code changes and updated an existing feature, make sure you satisfy the following:
waspc/examples/todoApp
and its e2e tests as needed and manually checked it works correctly.Update starter apps if needed
If you did code changes and updated an existing feature, make sure you satisfy the following:
basic
starter as needed and manually checked it works correctly.todo-ts
starter as needed and manually checked it works correctly.embeddings
starter as needed and manually checked it works correctly.saas
starter as needed and manually checked it works correctly.