- Notifications
You must be signed in to change notification settings - Fork5.2k
Add new line to be specified for JSON formatting#100890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Add new line to be specified for JSON formatting#100890
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Allow the new line string to use for indented JSON to be specified through options.Resolvesdotnet#84117.
ghost commentedApr 10, 2024
Note regarding the |
martincostello commentedApr 10, 2024
@eiriktsarpalis I've left this in draft for now before I dig around tomorrow and see if I've missed anything, but feel free to start reviewing at your convenience. |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.csShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.csShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonWriterOptionsTests.csShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/OptionsTests.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/libraries/System.Text.Json/src/System/Text/Json/Writer/JsonWriterHelper.csShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
martincostello commentedApr 11, 2024
Failing test is |
- Cater for `_newLine` in JsonSerializerOptions caching.- Lazily initialize field.- Allow null to reset to default.- Add assertions.- Add/update comments.- Use `nameof()`.- Remove redundant field.- Extend tests.
- Update property count to fix assertion.- Update test to validate `NewLine` can be set/bound.
Only normalize the line endings if the `JsonWriterOptions` are not using the defaults.
src/libraries/System.Text.Json/src/System/Text/Json/Writer/JsonWriterHelper.csShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...braries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.Caching.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...braries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.Caching.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
martincostello commentedApr 11, 2024
I'm not sure why the Mono tests are failing - there's something in the logs about how some of the tests take a long time to run under the interpreter, so I wonder if the extra test cases I've added to the combinations for |
...braries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.Caching.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
- Access lazily initialized field through property.- Update hash code assertion.
Use similar format string to `Format_InvalidGuidFormatSpecification`/
...braries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.Caching.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...braries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.Caching.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/libraries/System.Text.Json/src/System/Text/Json/Writer/JsonWriterOptions.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/OptionsTests.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
martincostello commentedApr 11, 2024
Looks like these areknown issues. |
Reword comment as suggested.
- Simplify condition.- Disallow null for `string NewLine` properties.
eiriktsarpalis commentedApr 12, 2024
We generally use the "Build Analysis" leg to determine if there any test failures that haven't been flagged as known issues. |
eiriktsarpalis left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks!
* Add new line to be specified for JSON formattingAllow the new line string to use for indented JSON to be specified through options.Resolvesdotnet#84117.* Address review feedback- Cater for `_newLine` in JsonSerializerOptions caching.- Lazily initialize field.- Allow null to reset to default.- Add assertions.- Add/update comments.- Use `nameof()`.- Remove redundant field.- Extend tests.* Update Logging.Console tests- Update property count to fix assertion.- Update test to validate `NewLine` can be set/bound.* Only normalize line endings if neededOnly normalize the line endings if the `JsonWriterOptions` are not using the defaults.* Address feedback- Access lazily initialized field through property.- Update hash code assertion.* Update exception messageUse similar format string to `Format_InvalidGuidFormatSpecification`/* Address feedbackReword comment as suggested.* Address feedback- Simplify condition.- Disallow null for `string NewLine` properties.
Allow the new line string to use for indented JSON to be specified through options.
Resolves#84117.