Ability to disable emitting anchors

Issue #541 wontfix
Piotr Krzemiński created an issue

Hi!

I've just started using snakeyaml to emit YAML in my library for authoring GitHub Actions workflows. Unfortunately, GitHub doesn't support anchors, and snakeyaml seems to be very eager to emit them: https://github.com/krzema12/github-actions-kotlin-dsl/issues/416

Could you add a configuration option to disable emitting anchors? Are you open to having such feature in the lib? I can contribute.

Alternatively, is there some workaround that I could use to patch my library?

Thanks,

Piotr

Comments (9)

  1. Piotr Krzemiński reporter

    Cool, I'll prepare one.

    One more question: when do you plan to release the next version? From what I see, the releases are rather rare which worries me a bit.

  2. Piotr Krzemiński reporter

    Ok, cool. To speed up iteration on the PR: do you have a vision where this flag can be added? I see at least two classes that deal with anchors. Any implementation hints greatly appreciated.

  3. Piotr Krzemiński reporter

    I went another path: snakeyaml-engine and event-based approach where I have greater freedom when emitting YAML. I just produce subsequent keys with {} values and no anchors are created. From my PoV, this feature request just got way less critical.

  4. Log in to comment