Skip to content

Add BigIntConverter to serialize BigInt types to string and update serializer options handling#12

Closed
matnun-br wants to merge 5 commits intomainfrom
fix/add-bigintconverter-serialize-to-string
Closed

Add BigIntConverter to serialize BigInt types to string and update serializer options handling#12
matnun-br wants to merge 5 commits intomainfrom
fix/add-bigintconverter-serialize-to-string

Conversation

@matnun-br
Copy link
Copy Markdown
Contributor

@matnun-br matnun-br commented Apr 7, 2026

  • Fix BigIntConverter.cs Read/Write methods:
    • Use reader.GetInt64()/reader.GetUInt64() instead of JsonSerializer.Deserialize<T>(ref reader)
    • Use invariant-culture parsing/formatting (CultureInfo.InvariantCulture)
    • Throw JsonException on parse failure
    • Build succeeds, serialization tests pass

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 JsonSerializerOptions creation via Serializer.GetOptions(...).
  • Add converters to serialize long/ulong values 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.

@matnun-br matnun-br marked this pull request as draft April 7, 2026 00:43
…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.
… UInt64ToStringConverter; update serializer options accordingly
@matnun-br matnun-br closed this Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants