-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Text.Jsonin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is mergedpartner-impactThis issue impacts a partner who needs to be kept updatedThis issue impacts a partner who needs to be kept updated
Milestone
Description
Updated API Proposal
Following conversation with @annelo-msft we identified the key use case is offering a non-allocating variant of the JsonElement.GetRawText
method. As such we should probably go ahead with the JsonMarshal
design:
namespace System.Runtime.InteropServices;
public partial class JsonMarshal
{
public static bool TryGetRawValue(JsonElement element, out ReadOnlySpan<byte> rawValue);
}
Furthermore:
- The raw value should always be a valid JSON value, therefore strings/properties must always include quotes.
- Composite values preserve whitespace and comments contained in the original JSON document.
AlexanderSher, grbell-ms, exyi and bill-poole
Metadata
Metadata
Assignees
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Text.Jsonin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is mergedpartner-impactThis issue impacts a partner who needs to be kept updatedThis issue impacts a partner who needs to be kept updated