Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encode/decode methods (serialization) #23

Open
DiegoPino opened this issue Sep 15, 2021 · 1 comment
Open

encode/decode methods (serialization) #23

DiegoPino opened this issue Sep 15, 2021 · 1 comment

Comments

@DiegoPino
Copy link

What?

The current parser is great. It would also be great to have a serializer/deserializer in the tone of json_encode/json_decode with options. If course this would only work consistently for a subset and would not be able to bring a full specs KDL doc into a PHP structure/object/arrays and then back without loosing/discarding data (e.g comments)

Since the logic/nodes etc (in my not too well versed in KDL opinion) could be seen as similar to an XML document serialization (with better typed data, etc), maybe some type of decorator type of processing (again going back to you can do that in PHP from XML to JSON) could work?

Just wondering if this is something others may want or the parse suffices the need. Thanks!

@shieldo
Copy link
Collaborator

shieldo commented Sep 15, 2021

I'd wait until the deserialised format has stabilised after there's full compliance with KDL 1.0 before writing any code to go back the other way - but some functionality to do that would be good and something I'd intend to add.

Likewise I'm interested in whether it's something people have an active need for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants