Add BigIntConverter to serialize BigInt types to string and update serializer options handling#12
Closed
Add BigIntConverter to serialize BigInt types to string and update serializer options handling#12
Conversation
…rializer options handling
There was a problem hiding this comment.
Pull request overview
Adds configurable JSON serializer options to support emitting 64-bit integers as strings (and caches options per configuration), updates client usage to rely on the new options API, and introduces tests for the new behavior.
Changes:
- Introduce cached, parameterized
JsonSerializerOptionscreation viaSerializer.GetOptions(...). - Add converters to serialize
long/ulongvalues as JSON strings (when enabled). - Update client/tests to use
Serializer.GetOptions()and validate 64-bit integer serialization.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| GraphQLSharp/Serialization/Serializer.cs | Replaces static options fields with cached, configurable options creation and updated Serialize/Deserialize APIs. |
| GraphQLSharp/Serialization/BigIntConverter.cs | Adds converters intended to write long/ulong as JSON strings. |
| GraphQLSharp/Client/GraphQLClient.cs | Switches HTTP JSON serialization/deserialization to use Serializer.GetOptions(). |
| GraphQLSharp.Tests/SerializationTests.cs | Updates DateTime tests and adds coverage for 64-bit integer string serialization. |
| GraphQLSharp.Tests/GraphQLClientTests.cs | Updates JSON element deserialization calls to use Serializer.GetOptions(). |
| GraphQLSharp/GraphQLSharp.csproj | Bumps package version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…JsonException on failure Agent-Logs-Url: https://github.com/Wish-Org/GraphQLSharp/sessions/32ed737e-ce79-41b5-9631-6df5fcb32431 Co-authored-by: matnun-br <185004289+matnun-br@users.noreply.github.com>
…re, and JsonException on failure" This reverts commit a749d31.
…ptions fields private
… UInt64ToStringConverter; update serializer options accordingly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BigIntConverter.csRead/Write methods:reader.GetInt64()/reader.GetUInt64()instead ofJsonSerializer.Deserialize<T>(ref reader)CultureInfo.InvariantCulture)JsonExceptionon parse failure