-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Closed
Closed
Copy link
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Text.Jsonpartner-impactThis issue impacts a partner who needs to be kept updatedThis issue impacts a partner who needs to be kept updated
Milestone
Description
EDIT: see #86442 (comment) for API proposal.
Original Proposal
I would like System.Text.Json to serialize/deserialize Memory/ReadOnlyMemory<T> using the same logic as it uses for T[].
This implies:
Memory<byte>should be base64-encoded just likebyte[]isMemory<FooBar>should be serialized as appropriate for the typeFooBar, same asFooBar[]would.
The main motivation is that I have an array from ArrayPool<T>.Shared, which can have space for more items than I actually need. To serialize only a segment of the array, I would like to use Memory<T> to identify only use "used" part of the array.
Reactions are currently unavailable
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.Jsonpartner-impactThis issue impacts a partner who needs to be kept updatedThis issue impacts a partner who needs to be kept updated