a single ' causes atmos to error out when using !template tojson
- Dominant language
- Go
- Stars
- 1.4k
- Forks
- 175
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 134
Description
### Describe the Bug
have an atmos setup that uses !template toJson.
within my json, I have a single ' inside a specific json field.

### Expected Behavior
atmos should be able to handle the json field to have ' with no issue.

### Steps to Reproduce
in stack, use _defaults.yaml
```yaml
settings:
templates:
settings:
gomplate:
timeout: 5
datasources:
vars_defaults:
url: "../../Variables/defaults.json"
```
in top level overrides.yaml, include
```yaml
vars:
bedrock_agent_configs: !template '{{ toJson (datasource "vars_merged_final").bedrock_agent_configs }}'
```
in enviornment level (dev), override.yaml:
```yaml
settings:
templates:
settings:
gomplate:
timeout: 5
datasources:
vars_environment:
url: ../../Variables/dev.json
vars_merged_final:
url: merge:vars_environment|vars_defaults
```
### Screenshots
_No response_
### Environment
OS: Window
version 26100.3915
module - n/a
terraform: 1.11.3
### Additional Context
_No response_
Contributor guide
Research direction
Start by reproducing the issue with _defaults.yaml, top-level overrides.yaml, the dev environment override.yaml, and the !template toJson expression using the shown datasource configuration. Trace how the gomplate template processes the JSON field containing a single quote; done means the same configuration renders successfully without an error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- terraform
- Domain
- cli, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100