You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unlike full YAML, YAML::Tiny doesn't allow objects. In this way, it has the same constraint as JSON. There is already a well-accepted convention for objects serializing to JSON by providing a TO_JSON method. If YAML::Tiny checked for TO_JSON on objects before dying, we could take advantage of existing methods and conventions.
This would take very little code and would make it much easier for people to serialize data structures that might have string-like objects, including versions, paths, datetimes, etc.
The text was updated successfully, but these errors were encountered:
+1 on adding support (it assists the migration of the toolchain from YAML to JSON).
-0 on making it the default option, should it be an option passed to the ->write and/or dump methods?
Sereal is supporting the Types::Serialiser protocol with FREEZE/THAW (introduced for CBOR and JSON::XS version 3). It seems reasonably sane and flexible and with those serializers supporting it may become a defacto standard we could follow instead of the limiting, one-way, TO_JSON approach.
It's not entirely Tiny, though, as it would require support for tags, I think.
Unlike full YAML, YAML::Tiny doesn't allow objects. In this way, it has the same constraint as JSON. There is already a well-accepted convention for objects serializing to JSON by providing a TO_JSON method. If YAML::Tiny checked for TO_JSON on objects before dying, we could take advantage of existing methods and conventions.
This would take very little code and would make it much easier for people to serialize data structures that might have string-like objects, including versions, paths, datetimes, etc.
The text was updated successfully, but these errors were encountered: