Open xnox opened 7 months ago
@xnox thanks! any chance you could add an example? Like steps to reproduce and how that differs from what we want it to look like?
Running yam on following YAML
public: &public_bucket
type: "amazon-s3"
url: "%env(CDN_URL)%"
visibility: "public"
config:
bucket: "%env(AWS_PUBLIC_FILESYSTEM_BUCKET)%"
region: "%env(AWS_REGION)%"
endpoint: "%env(AWS_ENDPOINT_URL)%"
use_path_style_endpoint: true
theme: *public_bucket
asset: *public_bucket
generates invalid yaml to:
public:
type: "amazon-s3"
url: "%env(CDN_URL)%"
visibility: "public"
config:
bucket: "%env(AWS_PUBLIC_FILESYSTEM_BUCKET)%"
region: "%env(AWS_REGION)%"
endpoint: "%env(AWS_ENDPOINT_URL)%"
use_path_style_endpoint: true
theme:
*public_bucket
asset:
*public_bucket
Thanks @shyim, that's helpful. 🙏
This is most likely a bug in the underlying YAML library, gopkg.in/yaml.v3
. My medium-term plan is to swap that out with a better YAML library.
Any ideas for shorter-term fixes are welcome, too.
Thanks @shyim, that's helpful. 🙏
This is most likely a bug in the underlying YAML library,
gopkg.in/yaml.v3
. My medium-term plan is to swap that out with a better YAML library.Any ideas for shorter-term fixes are welcome, too.
it's difference of parsing expanded yaml versus unexpanded. Note that because it is references, one has to take special care when parsing them "literary" or not. It does have support for anchor types, and how to print them. I haven't looked at yam code if it checks for anchors or not.
None theless, I think @stormqueen1990 mentioned one of the better maintained forks of yam.v3..... was it a hashicorp fork? or something else?
None theless, I think @stormqueen1990 mentioned one of the better maintained forks of yam.v3..... was it a hashicorp fork? or something else?
The one I know about is https://github.com/kubernetes-sigs/yaml, though I'm unsure if it would fix the issue at hand 🤔
yaml files with anchors are not correctly formatted.