Comments (3)
@rymndhng
This library seems to be actively maintained here: https://github.com/clj-commons/clj-yaml
I'd be interested to hear what the differences between owainlewis/yaml and clj-yaml are.
from clj-yaml.
Hey @borkdude. It's been a while since I've needed to work with yaml
in clojure. It looks like both libraries are built on top of the Java Library snakeyaml
. Furthermore, both attempt to convert YAML into Clojure Data Structure (yay)!
One useful feature of owainlewis/yaml
is the ability to ignore unknown YAML tags using the passthrough-constructor
. I've had to use this in the past to parse yaml generated by other tools/languages. Arguably, this feature should be easy to port to clj-commons/yaml ;)
Example:
With clj-commons/clj-yaml
❯ clj -Sdeps '{:deps {clj-commons/clj-yaml {:mvn/version "0.7.0"}}}'
user=> (require '[clj-yaml.core :as yaml])
user=> (yaml/parse-string "--- !foobar
foo: HELLO WORLD")
Execution error (ConstructorException) at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructUndefined/construct (SafeConstructor.java:539).
could not determine a constructor for the tag !foobar
in 'string', line 1, column 5:
--- !foobar
^
With owainlewis/yaml
using :passthrough-constructor
❯ clj -Sdeps '{:deps {io.forward/yaml {:mvn/version "1.0.10"}}}'
user=> (require '[yaml.core :as yaml])
user=> (yaml/parse-string "--- !foobar
foo: HELLO WORLD" :constructor yaml.reader/passthrough-constructor)
#ordered/map ([:foo "HELLO WORLD"])
from clj-yaml.
Thanks for the information!
from clj-yaml.
Related Issues (10)
- can deserialize a Set, but can't serialize a Set HOT 2
- serialized !!clojure.lang.Symbol has no content HOT 2
- feature request: optional parameters for primitives
- Problem with maps using integer keys HOT 2
- Reflection Warnings
- Enable decode of java.util.ArrayList as vector instead of list HOT 1
- Upgrade snakeyaml dependency to [org.yaml/snakeyaml "1.17"]
- No license HOT 3
- feature request: dump/load preferred over parse/generate
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clj-yaml.