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
{{ message }}
Repository navigation
Consider serialization / deserialization to JSON #504
Configuration objects (my use case). You have a model that is complex enough to require a number of input parameters, some of them nested. Maybe you started with a list, but it's getting hard to keep track of all necessary fields, so you move to a class. Would be extremely handy to be able to read/write configurations directly to/from files (JSON, YAML, TOML, etc.)
Accepting structured data from a web API directly into a class.
Many non-web systems produce structured data, and it would be very convenient to be able to ingest their data directly into a class.
Issues with this suggestion
Seems like a minefield of edge cases
Lots of hard choices on how opinionated should such a system should be:
automatic type conversion, e.g. should it automatically convert a string to a date?
nested cases, e.g. how do you manage an Address class inside a Person class.
case matching, e.g. called address in JSON, but your property/class name is Address
Feel free to say "won't do" and close; I'm aware this is a big ask 😅.
Reacted by Agastya Mondal, PhD, Zachary Susswein, argxltuijnder, Maxwell Murphy, Tomasz Kalinowski and eitsupi
@natemcintosh@hadley is there any work on this? If no one started working on this I might pick it up and investigate. I would also be interested in conversion to a list, that's why I came here. I also saw this one #547
In order to communicate with LLMs, it converts between S7 classes and JSON schema, and (de)serializes objects in accordance with schemas. It's quite complete and I would be happy to work with someone who wanted to extract it into its own package.
@lawremi great, I will have a look. serialization/transformation process is needed in a lot of packages, so it would be nice to have one package to just do that, and separate the whole logic in one place for people to use.
changed the title [-]Feature Request: automatic serialization / deserialization of S7 classes[/-][+]Consider serialization / deserialization to JSON[/+]on May 29, 2026
Activity
vladimirobucina commentedon Aug 28, 2025
@natemcintosh @hadley is there any work on this? If no one started working on this I might pick it up and investigate. I would also be interested in conversion to a list, that's why I came here. I also saw this one #547
natemcintosh commentedon Aug 28, 2025
@vladimirobucina I have not done any work on this.
lawremi commentedon Aug 28, 2025
Check out the wizrd package: https://github.com/lawremi/wizrd.
In order to communicate with LLMs, it converts between S7 classes and JSON schema, and (de)serializes objects in accordance with schemas. It's quite complete and I would be happy to work with someone who wanted to extract it into its own package.
vladimirobucina commentedon Aug 28, 2025
@lawremi great, I will have a look. serialization/transformation process is needed in a lot of packages, so it would be nice to have one package to just do that, and separate the whole logic in one place for people to use.
mmaechler commentedon Sep 6, 2025
A propos "general" (de-/)serialization: Is it possible (probably not ..) to come up with a general scheme for the case where most of the R object is from an external pointer; I'm interested "in the name" of @JaganM and his
{flint}packagehttps://github.com/jaganmn/flint where serialization of "flint-numbers" is also still open.
[-]Feature Request: automatic serialization / deserialization of S7 classes[/-][+]Consider serialization / deserialization to JSON[/+]