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

[proposal] (De)serializing (to)from structured types #115

Open
clamydo opened this issue May 17, 2021 · 2 comments
Open

[proposal] (De)serializing (to)from structured types #115

clamydo opened this issue May 17, 2021 · 2 comments

Comments

@clamydo
Copy link

clamydo commented May 17, 2021

The JSON3 package uses StructTypes to map data from a JSON-file into a Julia data structure. See https://quinnj.github.io/JSON3.jl/stable/#Read-JSON-into-a-type

Potentially, this approach offers a more type safe alternative to the current Dict based approach. It basically allows to specify a schema of the YAML file as a Julia type, which can be validated while parsing.

Perhaps, this package could follow a similar route?

This concept is also used very successfully by Rust's serde crate.

This issue arose in #70

@kescobo
Copy link
Collaborator

kescobo commented May 17, 2021

I think it's a great idea. Over on #70 , @christopher-dG also commented:

YAML has tags to facilitate that, we could do something similar to what pyyaml does

Alternatively just using StructTypes would also be really good

@ufechner7
Copy link

Would be very nice to have!

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

No branches or pull requests

3 participants