Skip to content

Add JSON serialization format using Xrm.Json.Serialization #19

Description

@imranakram

The current XML-based serialization (Simple, Explicit, Full) has several limitations:

  • Manual type handling - each XRM type (EntityReference, OptionSetValue, Money, OptionSetValueCollection, etc.) requires hand-written serialization and deserialization cases in EntityExtensions.cs and Common.cs. Every new type requires code changes in multiple places.
  • Verbosity - XML is significantly larger than equivalent JSON, slowing I/O for large datasets.
    Fragile round-trip - type fidelity depends on string tags like type="OptionSetValue" that must be maintained manually.

Proposal

Add a new SerializationStyle.Json option backed by Xrm.Json.Serialization, which natively handles all Microsoft.Xrm.Sdk types including EntityReference, OptionSetValue, OptionSetValueCollection, Money, AliasedValue, etc.

Benefits

  • Zero manual type handling - new attribute types are supported automatically
  • Compact output - typically 40-60% smaller than equivalent XML
  • Git-friendly - JSON with sorted keys produces clean, readable diffs
  • Standard tooling - JSON is universally supported for diffing, querying (jq), and editing

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions