metafacture / metafacture-core

Core package of the Metafacture tool suite for metadata processing.
https://metafacture.org
Apache License 2.0
69 stars 34 forks source link

Implement YAML module. #400

Closed blackwinter closed 2 years ago

blackwinter commented 2 years ago

Based off of JSON module. But not every feature of the JSON implementation can be (easily/reasonably) supported in the YAML implementation (decoder: optional comments, JsonPath; encoder: root value separator, (optional) pretty printing).

Maybe there's room for consolidation, though, with YAML being a superset of JSON. Both pairs of classes could (should?) have a common superclass implementing the actual decoding/encoding.

Fixes #399.

acka47 commented 2 years ago

@blackwinter please merge

blackwinter commented 2 years ago

So we're not going to discuss the intrinsic relationship between the two modules? Are we content with the duplication?

dr0i commented 2 years ago
acka47 commented 2 years ago

So we're not going to discuss the intrinsic relationship between the two modules? Are we content with the duplication?

You are right. We got confused about where we are in the process. @fsteeg will review.

blackwinter commented 2 years ago

we can always extract a superclass later, when/if we see that we're actually building/fixing stuff in both modules.

Well, let's hope we don't forget... :slightly_smiling_face:

fsteeg commented 2 years ago

Well, let's hope we don't forget... :slightly_smiling_face:

One could argue that we should wait for supporting a third JSON-like format before we even consider extracting it: https://en.wikipedia.org/wiki/Rule_of_three_(computer_programming)