clj-commons / clj-yaml

YAML encoding and decoding for Clojure
Other
122 stars 26 forks source link

Parsing problem when "/" in yaml key #26

Closed jerneyio closed 2 years ago

jerneyio commented 2 years ago

I'm trying to parse a document type (RAML) that uses "/" in certain keys:

(require '[clj-yaml.core :as yml])

(yml/parse-string "application/json:\n  data")

This returns: #:application{:json "data"}, but I was expecting something like this: {:application/json "data"}. Is there a way I can accommodate these "/" chars in the keys without using :keywords false?

borkdude commented 2 years ago

@jerneyio This is just the way Clojure prints maps with namespaced keys. Try (set! *print-namespace-maps* false) to change this.

jerneyio commented 2 years ago

Thank you for the suggestion, I'm still learning!