-
Notifications
You must be signed in to change notification settings - Fork 47
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
Default serialization method for structs #139
Comments
This was discussed and was the default for a short period of time, but it led to some hard-to-figure-out bugs where things accidentally serialized, but not in the way you wanted. Because everything was a Can you comment more on the cases you're running into w/ types you don't own? If they're in Base or stdlibs, we can define them in JSON3.jl or StructTypes.jl. Otherwise, it might be worth contacting the type package owners and seeing if we can work something out. |
One type was |
It already satisfies the `StringType` interface, so it's an easy definition. Fixes one issue mentioned in quinnj/JSON3.jl#139.
Ah, yeah, that's a good one. It's really easy to add a default definition for that, as you can see in my PR here: JuliaData/StructTypes.jl#44. Let me know if you run into any other issues where we could ahve default definitions that would be helpful. |
It already satisfies the `StringType` interface, so it's an easy definition. Fixes one issue mentioned in quinnj/JSON3.jl#139.
I am new to this library so please let me know if I am missing something, but why isn't the default serialization method for a struct
StructTypes.Struct()
? This means that if I need to serialize some struct, I need to implementfor every struct I need to serialize, including types I don't own and/or don't interface with directly. I think that
StructTypes.Struct()
would be a sensible default.The text was updated successfully, but these errors were encountered: