Migration from Newtonsoft.Json to System.Text.Json
In our efforts to deliver better performance and streamline our services, we are migrating from Newtonsoft.Json to System.Text.Json for JSON serialization and deserialization in our APIs. This migration introduces improvements and stricter handling of JSON data, which may require customers to review and adjust their API integrations for compatibility. Please read below for relevant details and examples.
________________________________________
Key Changes 1. Stricter JSON Standards: - System.Text.Json enforces stricter JSON rules compared to Newtonsoft.Json. Adjustments may be required to ensure compliance with the following key standards: - Quoted property names - Consistent number formatting - Avoiding trailing commas - Correct handling of boolean values 2. Case-Sensitive Property Matching: - Unlike Newtonsoft.Json, System.Text.Json is case-sensitive by default. Property names in your JSON data must match the API specifications precisely (including case).
________________________________________
Examples of Correct and Incorrect JSON
To assist with your adjustments, here are examples of bad and good JSON formatting based on common issues:
Avoid using trailing commas in JSON. Bad: { "SomeProperty": "Some text", }
Good: { "SomeProperty": "Some text" }
________________________________________
Boolean Values:
Ensure booleans are properly written as true or false without quotes. Bad: { "IsSigned": "true" } Good: { "IsSigned": true } ________________________________________
To ensure a smooth transition, we recommend you review your integration:
- Verify your JSON payloads adhere to proper formatting (using the above examples as a guide) and match the API specifications.
________________________________________
Timeline
This migration is scheduled for October 21st between 8:00 and 9:00 AM CEST. Please check whether any updates to your integrations are needed before this date, and make adjustments if necessary to avoid disruptions.
If you have any concerns about this date, please contact us at support@signhost.com.