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

Implement support for Json serialization #144

Open
Jones-Adam opened this issue Jan 15, 2018 · 7 comments
Open

Implement support for Json serialization #144

Jones-Adam opened this issue Jan 15, 2018 · 7 comments

Comments

@Jones-Adam
Copy link
Contributor

Provide support so that newtonsoft.json can serialize Spatial types

@Jones-Adam
Copy link
Contributor Author

#145 implements a JsonConverter that can handle all spatial types.
using it is fairly trivial
To Serialize:

Point2D p = new Point2D(1,2);
JsonSerializerSettings settings = new JsonSerializerSettings();
settings.Converters.Add(new SpatialJsonConverter());
string jsonString = JsonConvert.SerializeObject(p, settings);

To Deserialize:

JsonSerializerSettings settings = new JsonSerializerSettings();
settings.Converters.Add(new SpatialJsonConverter());
JsonConvert.DeserializeObject(jsonString, settings);

Are there any other use cases to support with json serialization?

@Leon99
Copy link

Leon99 commented Sep 13, 2019

@Jones-Adam it's been 1.5 years... Any chances of merging the serialization branch into master and releasing a nuget for it? I'm not sure what's the blocker there, but am willing to contribute.

@samirem
Copy link

samirem commented Oct 30, 2020

Hi! I agree, with @Leon99, why has this not been released yet?

@Jones-Adam
Copy link
Contributor Author

@Leon99 @samirem Releases are handled by @cdrnet for this repository. While the code was feature complete at the time it was written, I would imagine that it should be updated to support the current library versions and maybe add support for MessagePack as well before being merged.

@jkalias
Copy link
Member

jkalias commented Mar 30, 2023

Can we please revive this issue now that #181 has been pushed to master?

@Jones-Adam
Copy link
Contributor Author

revive away - the sticking point last time was concern the packaging of support for multiple serialization libraries introduced dependencies, even if optional. Let me know how you want it put together and I am happy to update the code to support the latest versions of the libraries

@jkalias
Copy link
Member

jkalias commented Apr 3, 2023

Hi @Jones-Adam , thanks for replying. I managed to fix some bus and create a new v0.7.0 tag, however I have not been able to reach out to @cdrnet; I have no rights neither to publish the nuget package in the name of the Math.NET (NuGet) organisation, nor to update the project website or documentation. 😞

I think the idea that was thrown at #47 , that we offer XML and JSON serialization as separate nugets, is definitely worth investigating.

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

4 participants