Skip to content

YAML sets and Clojure sets #6

Open

Description

@asllop

Currently, YAMLStar only support JSON-compatible values, which means a YAML like this:

my-set:
  ? One
  ? Two
  ? Three

Parses to:

{"my-set" {"One" nil, "Three" nil, "Two" nil}}

And trying to serialize this:

{"my-set" #{"One" "Two" "Three"}}

Causes the following error: YAMLStar dump only supports JSON-compatible values.

Currently, clj-yaml also parses to something similar, unless the type is specified:

my-set: !!set
  ? One
  ? Two
  ? Three

In which case it correctly generates a Clojure set (the serialization isn't correct though).

Would be nice if YAMLStar could:

  1. Parse to a Clojure set, at least when the type !!set is specified.
  2. Serialize to a YAML set when the input is a Clojure set.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions