这是indexloc提供的服务,不要输入任何密码
Skip to content

Add IJsonSerializer and SystemJsonSerializer #1123

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

Merged
merged 7 commits into from
Jan 2, 2025
Merged

Conversation

nozzlegear
Copy link
Owner

This PR introduces the IJsonSerializer interface, with a default implementation of SystemJsonSerializer. Just like #1122, the goal here is threefold:

  1. Make it easy for users to control and customize exactly what gets serialized and sent to Shopify's servers, in addition to how the data gets deserialized when it comes back.
  2. Support users swapping out System.Text.Json with their favorite Json serializer, such as Newtonsoft.Json, or vice versa.
  3. Make unit testing easier and more versatile.
  4. Support more Dependency Injection scenarios.

Note: this is currently detached and entirely separate from the existing Newtonsoft serializers/converters we have in the package, and from the static serializers in the ShopifySharp.Infrastructure.Serializer class (though it does use default System.Text.Json serializer settings from there). It's also separate from the System.Json.Text serializers that we have set up in the ShopifySharp.GraphQL namespace.

I want to remedy that quickly and standardize them all under the IJsonSerializer interface.

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

Successfully merging this pull request may close these issues.

1 participant