Skip to content

fixes and features - #415

Merged
SimonCropp merged 1 commit into
mainfrom
fixes-and-features
Oct 6, 2026
Merged

SimonCropp merged 1 commit into
mainfrom
fixes-and-features

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

Fixes

  • Fix quadratic handling of duplicate property names in JTokenWriter. A duplicate now replaces the existing property in its original position instead of moving to the end
  • Throw JsonSerializationException for a non-string $type
  • Detect negative zero by comparing bits rather than dividing by zero
  • Fix default value population for renamed constructor parameters
  • Fix "Duplicate attribute" when converting nested single item arrays to an XDocument
  • Keep the json:Array marker on single item arrays whose names need XML encoding
  • Support Index and list patterns on JArray
  • Write comments containing "*/" as line comments
  • Fix InvalidCastException comparing a BigInteger JValue with a short, ushort, byte, sbyte or enum JValue
  • Set a value type member to its default when given null, instead of throwing
  • Read TimeOnly with TimeOnly.Parse so "13:45" is accepted
  • Drop "Required" from the DisallowNull error message
  • Reduce allocations in ToMultidimensionalArray
  • Throw from the serializer's dynamic paths when DynamicIsSupported is off, and honour the switch in JObject and JValue

Features

  • Serialize Int128, UInt128 and Half as JSON numbers. They were previously written as strings, which are still read
  • Serialize Memory and ReadOnlyMemory as arrays, or base64 when T is byte

Unions

  • Ignore $id, $type, $ref and $values when matching object cases by property name
  • Use $type to select a case when TypeNameHandling is enabled. TypeNameHandling.Auto now writes the type of the case
  • Select the case for a $ref from the referenced object
  • Treat an object holding $values as an array
  • Match cases read by a converter, and object and JToken cases, against any JSON shape. An enum read by StringEnumConverter matches strings and numbers
  • Read "NaN", "Infinity" and "-Infinity" into float and double cases

Fixes
- Fix quadratic handling of duplicate property names in JTokenWriter.
  A duplicate now replaces the existing property in its original
  position instead of moving to the end
- Throw JsonSerializationException for a non-string $type
- Detect negative zero by comparing bits rather than dividing by zero
- Fix default value population for renamed constructor parameters
- Fix "Duplicate attribute" when converting nested single item arrays
  to an XDocument
- Keep the json:Array marker on single item arrays whose names need
  XML encoding
- Support Index and list patterns on JArray
- Write comments containing "*/" as line comments
- Fix InvalidCastException comparing a BigInteger JValue with a
  short, ushort, byte, sbyte or enum JValue
- Set a value type member to its default when given null, instead of
  throwing
- Read TimeOnly with TimeOnly.Parse so "13:45" is accepted
- Drop "Required" from the DisallowNull error message
- Reduce allocations in ToMultidimensionalArray
- Throw from the serializer's dynamic paths when DynamicIsSupported is
  off, and honour the switch in JObject and JValue

Features
- Serialize Int128, UInt128 and Half as JSON numbers. They were
  previously written as strings, which are still read
- Serialize Memory<T> and ReadOnlyMemory<T> as arrays, or base64 when
  T is byte

Unions
- Ignore $id, $type, $ref and $values when matching object cases by
  property name
- Use $type to select a case when TypeNameHandling is enabled.
  TypeNameHandling.Auto now writes the type of the case
- Select the case for a $ref from the referenced object
- Treat an object holding $values as an array
- Match cases read by a converter, and object and JToken cases,
  against any JSON shape. An enum read by StringEnumConverter matches
  strings and numbers
- Read "NaN", "Infinity" and "-Infinity" into float and double cases
@SimonCropp SimonCropp added this to the 0.38.0 milestone Oct 6, 2026
@SimonCropp
SimonCropp merged commit 8ac3e46 into main Oct 6, 2026
4 checks passed
@SimonCropp
SimonCropp deleted the fixes-and-features branch October 6, 2026 09:50
This was referenced Oct 6, 2026
This was referenced Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant