From 3a41a573b328b9076f4b6bbc7fe06788333eef9c Mon Sep 17 00:00:00 2001 From: carlossanlop Date: Tue, 30 Jul 2019 16:56:09 -0700 Subject: [PATCH 1/3] Automatically port System.Text.Json.JsonSerializer --- xml/System.Text.Json/JsonSerializer.xml | 308 +++++++++++++++++------- 1 file changed, 224 insertions(+), 84 deletions(-) diff --git a/xml/System.Text.Json/JsonSerializer.xml b/xml/System.Text.Json/JsonSerializer.xml index 3b3bfc29204..fadd361f2cc 100644 --- a/xml/System.Text.Json/JsonSerializer.xml +++ b/xml/System.Text.Json/JsonSerializer.xml @@ -14,7 +14,7 @@ - To be added. + Provides functionality to serialize objects or value types to JSON and deserialize JSON into objects or value types. To be added. @@ -38,12 +38,22 @@ - To be added. - To be added. - To be added. - To be added. - To be added. + JSON text to parse. + The type of the object to convert to and return. + Options to control the behavior during parsing. + Parse the UTF-8 encoded text representing a single JSON value into a . + A representation of the JSON value. To be added. + is . + The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. + is . + The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. + is . + The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. + is . + The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. + is . + The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. @@ -66,12 +76,31 @@ - To be added. - To be added. - To be added. - To be added. - To be added. - To be added. + The JSON text to parse. + The type of the object to convert to and return. + The options to control the behavior during parsing. + Parses the text representing a single JSON value into a . + A representation of the JSON value. + + is not as efficient as using the +UTF-8 methods since the implementation natively uses UTF-8. + + ]]> + + or is . + The JSON is invalid, the is not compatible with the JSON, or when there is remaining data in the Stream. + or is . + The JSON is invalid, the is not compatible with the JSON, or when there is remaining data in the Stream. + or is . + The JSON is invalid, the is not compatible with the JSON, or when there is remaining data in the Stream. + or is . + The JSON is invalid, the is not compatible with the JSON, or when there is remaining data in the Stream. + or is . + The JSON is invalid, the is not compatible with the JSON, or when there is remaining data in the Stream. @@ -94,12 +123,43 @@ - To be added. - To be added. - To be added. - To be added. - To be added. - To be added. + The reader to read. + The type of the object to convert to and return. + Options to control the serializer behavior during reading. + Reads one JSON value (including objects or arrays) from the provided reader into a . + A representation of the JSON value. + + property of is or , the reader will be advanced by one call to to determine the start of the value. + +Upon completion of this method will be positioned at the final token in the JSON value. If an exception is thrown the reader is reset to the state it was in when the method was called. + +This method makes a copy of the data the reader acted on, so there is no caller requirement to maintain data integrity beyond the return of this method. + +The used to create the instance of the take precedence over the when they conflict. + +Hence, , , are used while reading. + + ]]> + + is . + The JSON is invalid, is not compatible with the JSON, or a value could not be read from the reader. + is using unsupported options. + is . + The JSON is invalid, is not compatible with the JSON,or a value could not be read from the reader. + is using unsupported options. + is . + The JSON is invalid, is not compatible with the JSON, or a value could not be read from the reader. + is using unsupported options. + is . + The JSON is invalid, is not compatible with the JSON, or a value could not be read from the reader. + is using unsupported options. + is . + The JSON is invalid, is not compatible with the JSON, or a value could not be read from the reader. + is using unsupported options. @@ -125,11 +185,16 @@ To be added. - To be added. - To be added. - To be added. - To be added. + JSON text to parse. + Options to control the behavior during parsing. + Parse the UTF-8 encoded text representing a single JSON value into a . + A representation of the JSON value. To be added. + The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. + The JSON is invalid, is not compatible with the JSON,or when there is remaining data in the Stream. + The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. + The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. + The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. @@ -155,11 +220,28 @@ To be added. - To be added. - To be added. - To be added. - To be added. - To be added. + JSON text to parse. + Options to control the behavior during parsing. + Parse the text representing a single JSON value into a . + A representation of the JSON value. + + is not as efficient as using the UTF-8 methods since the implementation natively uses UTF-8. + ]]> + + is . + The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. + is . + The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. + is . + The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. + is . + The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. + is . + The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. @@ -185,11 +267,37 @@ To be added. - To be added. - To be added. - To be added. - To be added. - To be added. + The reader to read. + Options to control the serializer behavior during reading. + Reads one JSON value (including objects or arrays) from the provided reader into a . + A representation of the JSON value. + + property of is or , the reader will be advanced by one call to to determine the start of the value. + +Upon completion of this method will be positioned at the final token in the JSON value. If an exception is thrown the reader is reset to the state it was in when the method was called. + +This method makes a copy of the data the reader acted on, so there is no caller requirement to maintain data integrity beyond the return of this method. + +The used to create the instance of the take precedence over the when they conflict. + +Hence, , , are used while reading. + + ]]> + + The JSON is invalid, is not compatible with the JSON, or a value could not be read from the reader. + is using unsupported options. + The JSON is invalid, is not compatible with the JSON, or a value could not be read from the reader. + is using unsupported options. + The JSON is invalid, is not compatible with the JSON, or a value could not be read from the reader. + is using unsupported options. + The JSON is invalid, is not compatible with the JSON, or a value could not be read from the reader. + is using unsupported options. + The JSON is invalid, is not compatible with the JSON, or a value could not be read from the reader. + is using unsupported options. @@ -212,13 +320,23 @@ - To be added. - To be added. - To be added. - To be added. - To be added. - To be added. + JSON data to parse. + The type of the object to convert to and return. + Options to control the behavior during reading. + The which may be used to cancel the read operation. + Read the UTF-8 encoded text representing a single JSON value into a . The Stream will be read to completion. + A representation of the JSON value. To be added. + or is . + The JSON is invalid, the is not compatible with the JSON, or when there is remaining data in the Stream. + or is . + The JSON is invalid, the is not compatible with the JSON, or when there is remaining data in the Stream. + or is . + The JSON is invalid, the is not compatible with the JSON, or when there is remaining data in the Stream. + or is . + The JSON is invalid, the is not compatible with the JSON, or when there is remaining data in the Stream. + or is . + The JSON is invalid, the is not compatible with the JSON, or when there is remaining data in the Stream. @@ -244,12 +362,18 @@ To be added. - To be added. - To be added. - To be added. - To be added. - To be added. + JSON data to parse. + Options to control the behavior during reading. + The which may be used to cancel the read operation. + Read the UTF-8 encoded text representing a single JSON value into a . + The Stream will be read to completion. + A representation of the JSON value. To be added. + The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. + The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. + The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. + The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. + The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. @@ -272,12 +396,20 @@ - To be added. - To be added. - To be added. - To be added. - To be added. - To be added. + The value to convert. + The type of the to convert. + Options to control the conversion behavior. + Convert the provided value into a . + A representation of the value. + + is not as efficient as using UTF-8 encoding since the implementation internally uses UTF-8. See also and . + + ]]> + @@ -302,10 +434,10 @@ To be added. - To be added. - To be added. - To be added. - To be added. + The value to convert and write. + The type of the to convert. + Options to control the behavior. + Write one JSON value (including objects or arrays) to the provided writer. To be added. @@ -332,11 +464,19 @@ To be added. - To be added. - To be added. - To be added. - To be added. - To be added. + The value to convert. + Options to control the conversion behavior. + Convert the provided value into a . + A representation of the value. + + is not as efficient as using UTF-8 encoding since the implementation internally uses UTF-8. See also and . + + ]]> + @@ -363,10 +503,10 @@ To be added. - To be added. - To be added. - To be added. - To be added. + The writer to write. + The value to convert and write. + Options to control the behavior. + Write one JSON value (including objects or arrays) to the provided writer. To be added. @@ -391,13 +531,13 @@ - To be added. - To be added. - To be added. - To be added. - To be added. - To be added. - To be added. + The UTF-8 to write to. + The value to convert. + The type of the to convert. + Options to control the conversion behavior. + The which may be used to cancel the write operation. + Convert the provided value to UTF-8 encoded JSON text and write it to the . + A task that represents the asynchronous write operation. To be added. @@ -425,12 +565,12 @@ To be added. - To be added. - To be added. - To be added. - To be added. - To be added. - To be added. + The UTF-8 to write to. + The value to convert. + Options to control the conversion behavior. + The which may be used to cancel the write operation. + Convert the provided value to UTF-8 encoded JSON text and write it to the . + A task that represents the asynchronous write operation. To be added. @@ -454,11 +594,11 @@ - To be added. - To be added. - To be added. - To be added. - To be added. + The value to convert. + The type of the to convert. + Options to control the conversion behavior. + Convert the provided value into a array. + A UTF-8 representation of the value. To be added. @@ -485,10 +625,10 @@ To be added. - To be added. - To be added. - To be added. - To be added. + The value to convert. + Options to control the conversion behavior. + Convert the provided value into a array. + A UTF-8 representation of the value. To be added. From 3a4190cbfbea7036ce234a62529bc4555ae8b7ba Mon Sep 17 00:00:00 2001 From: Ron Petrusha Date: Wed, 31 Jul 2019 16:46:45 -0700 Subject: [PATCH 2/3] Update JsonSerializer.xml --- xml/System.Text.Json/JsonSerializer.xml | 232 +++++++++++------------- 1 file changed, 103 insertions(+), 129 deletions(-) diff --git a/xml/System.Text.Json/JsonSerializer.xml b/xml/System.Text.Json/JsonSerializer.xml index fadd361f2cc..bc785eb8246 100644 --- a/xml/System.Text.Json/JsonSerializer.xml +++ b/xml/System.Text.Json/JsonSerializer.xml @@ -14,7 +14,7 @@ - Provides functionality to serialize objects or value types to JSON and deserialize JSON into objects or value types. + Provides functionality to serialize objects or value types to JSON and to deserialize JSON into objects or value types. To be added. @@ -38,22 +38,14 @@ - JSON text to parse. + The JSON text to parse. The type of the object to convert to and return. Options to control the behavior during parsing. - Parse the UTF-8 encoded text representing a single JSON value into a . + Parses the UTF-8 encoded text representing a single JSON value into an instance of a specified type. A representation of the JSON value. To be added. is . The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. - is . - The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. - is . - The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. - is . - The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. - is . - The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. @@ -78,8 +70,8 @@ The JSON text to parse. The type of the object to convert to and return. - The options to control the behavior during parsing. - Parses the text representing a single JSON value into a . + Options to control the behavior during parsing. + Parses the text representing a single JSON value into an instance of a specified type. A representation of the JSON value. or is . The JSON is invalid, the is not compatible with the JSON, or when there is remaining data in the Stream. - or is . - The JSON is invalid, the is not compatible with the JSON, or when there is remaining data in the Stream. - or is . - The JSON is invalid, the is not compatible with the JSON, or when there is remaining data in the Stream. - or is . - The JSON is invalid, the is not compatible with the JSON, or when there is remaining data in the Stream. - or is . - The JSON is invalid, the is not compatible with the JSON, or when there is remaining data in the Stream. @@ -126,40 +110,25 @@ UTF-8 methods since the implementation natively uses UTF-8. The reader to read. The type of the object to convert to and return. Options to control the serializer behavior during reading. - Reads one JSON value (including objects or arrays) from the provided reader into a . + Reads one JSON value (including objects or arrays) from the provided reader and converts it into an instance of a specified type. A representation of the JSON value. property of is or , the reader will be advanced by one call to to determine the start of the value. +If the property of `reader` is or , the reader will be advanced by one call to to determine the start of the value. -Upon completion of this method will be positioned at the final token in the JSON value. If an exception is thrown the reader is reset to the state it was in when the method was called. +Upon completion of this method, `reader` will be positioned at the final token in the JSON value. If an exception is thrown, the reader is reset to the state it was in when the method was called. This method makes a copy of the data the reader acted on, so there is no caller requirement to maintain data integrity beyond the return of this method. -The used to create the instance of the take precedence over the when they conflict. - -Hence, , , are used while reading. +The used to create the instance of the take precedence over the when they conflict. Hence, , , and are used while reading. ]]> is . The JSON is invalid, is not compatible with the JSON, or a value could not be read from the reader. - is using unsupported options. - is . - The JSON is invalid, is not compatible with the JSON,or a value could not be read from the reader. - is using unsupported options. - is . - The JSON is invalid, is not compatible with the JSON, or a value could not be read from the reader. - is using unsupported options. - is . - The JSON is invalid, is not compatible with the JSON, or a value could not be read from the reader. - is using unsupported options. - is . - The JSON is invalid, is not compatible with the JSON, or a value could not be read from the reader. - is using unsupported options. @@ -184,17 +153,21 @@ Hence, , - To be added. - JSON text to parse. + The target type of the UTF-8 encoded text. + The JSON text to parse. Options to control the behavior during parsing. - Parse the UTF-8 encoded text representing a single JSON value into a . + Parses the UTF-8 encoded text representing a single JSON value into an instance of the type specified by a generic type parameter. A representation of the JSON value. To be added. - The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. - The JSON is invalid, is not compatible with the JSON,or when there is remaining data in the Stream. - The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. - The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. - The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. + The JSON is invalid. + +-or- + + is not compatible with the JSON. + +-or- + +There is remaining data in the stream. @@ -219,10 +192,10 @@ Hence, , - To be added. - JSON text to parse. + The target type of the JSON value. + The JSON text to parse. Options to control the behavior during parsing. - Parse the text representing a single JSON value into a . + Parses the text representing a single JSON value into an instance of the type specified by a generic type parameter. A representation of the JSON value. is not as efficient as using the UTF-8 methods sinc ]]> is . - The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. - is . - The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. - is . - The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. - is . - The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. - is . - The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. + The JSON is invalid. + +-or- + + is not compatible with the JSON. + +-or- + +There is remaining data in the stream. @@ -266,38 +239,36 @@ Using a is not as efficient as using the UTF-8 methods sinc - To be added. + The target type of the JSON value. The reader to read. - Options to control the serializer behavior during reading. - Reads one JSON value (including objects or arrays) from the provided reader into a . + Options to control serializer behavior during reading. + Reads one JSON value (including objects or arrays) from the provided reader into an instance of the type specified by a generic type parameter. A representation of the JSON value. property of is or , the reader will be advanced by one call to to determine the start of the value. +If the property of `reader` is or , the reader will be advanced by one call to to determine the start of the value. -Upon completion of this method will be positioned at the final token in the JSON value. If an exception is thrown the reader is reset to the state it was in when the method was called. +Upon completion of this method, `reader` will be positioned at the final token in the JSON value. If an exception is thrown, the reader is reset to the state it was in when the method was called. This method makes a copy of the data the reader acted on, so there is no caller requirement to maintain data integrity beyond the return of this method. -The used to create the instance of the take precedence over the when they conflict. - -Hence, , , are used while reading. +The used to create the instance of the take precedence over the when they conflict. Hence, , are used while reading. ]]> - The JSON is invalid, is not compatible with the JSON, or a value could not be read from the reader. - is using unsupported options. - The JSON is invalid, is not compatible with the JSON, or a value could not be read from the reader. - is using unsupported options. - The JSON is invalid, is not compatible with the JSON, or a value could not be read from the reader. - is using unsupported options. - The JSON is invalid, is not compatible with the JSON, or a value could not be read from the reader. - is using unsupported options. - The JSON is invalid, is not compatible with the JSON, or a value could not be read from the reader. - is using unsupported options. + The JSON is invalid. + +-or- + + is not compatible with the JSON. + +-or- + +There is remaining data in the stream. + uses unsupported options. @@ -320,23 +291,23 @@ Hence, , - JSON data to parse. + The JSON data to parse. The type of the object to convert to and return. Options to control the behavior during reading. - The which may be used to cancel the read operation. - Read the UTF-8 encoded text representing a single JSON value into a . The Stream will be read to completion. + A cancellation token that may be used to cancel the read operation. + Asynchronously reads the UTF-8 encoded text representing a single JSON value into an instance of a specified type. The stream will be read to completion. A representation of the JSON value. To be added. or is . - The JSON is invalid, the is not compatible with the JSON, or when there is remaining data in the Stream. - or is . - The JSON is invalid, the is not compatible with the JSON, or when there is remaining data in the Stream. - or is . - The JSON is invalid, the is not compatible with the JSON, or when there is remaining data in the Stream. - or is . - The JSON is invalid, the is not compatible with the JSON, or when there is remaining data in the Stream. - or is . - The JSON is invalid, the is not compatible with the JSON, or when there is remaining data in the Stream. + The JSON is invalid. + +-or- + + is not compatible with the JSON. + +-or- + +There is remaining data in the stream. @@ -361,19 +332,22 @@ Hence, , - To be added. - JSON data to parse. + The target type of the JSON value. + The JSON data to parse. Options to control the behavior during reading. - The which may be used to cancel the read operation. - Read the UTF-8 encoded text representing a single JSON value into a . - The Stream will be read to completion. + A token that may be used to cancel the read operation. + Asynchronously reads the UTF-8 encoded text representing a single JSON value into an instance of a type specified by a generic type parameter. The stream will be read to completion. A representation of the JSON value. To be added. - The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. - The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. - The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. - The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. - The JSON is invalid, is not compatible with the JSON, or when there is remaining data in the Stream. + The JSON is invalid. + +-or- + + is not compatible with the JSON. + +-or- + +There is remaining data in the stream. @@ -399,8 +373,8 @@ Hence, , The value to convert. The type of the to convert. Options to control the conversion behavior. - Convert the provided value into a . - A representation of the value. + Converts the value of a specified type into a . + The string representation of the value. is not as efficient as using UTF-8 encoding since t - To be added. + The JSON writer. The value to convert and write. - The type of the to convert. - Options to control the behavior. - Write one JSON value (including objects or arrays) to the provided writer. + The type of . + Options to control serialization behavior. + Writes one JSON value (including objects or arrays) of a specified type to the provided writer. To be added. @@ -463,11 +437,11 @@ Using a is not as efficient as using UTF-8 encoding since t - To be added. + The type of the value to serialize. The value to convert. - Options to control the conversion behavior. - Convert the provided value into a . - A representation of the value. + Options to control serialization behavior. + Converts the value of a type specified by a generic type parameter into a . + A string representation of the value. is not as efficient as using UTF-8 encoding since t - To be added. - The writer to write. + The type of the value to serialize. + A JSON writer. The value to convert and write. - Options to control the behavior. - Write one JSON value (including objects or arrays) to the provided writer. + Options to control serialization behavior. + Writes one JSON value (including objects or arrays) of a type specified by a generic type parameter to the provided writer. To be added. @@ -531,12 +505,12 @@ Using a is not as efficient as using UTF-8 encoding since t - The UTF-8 to write to. + The UTF-8 stream to write to. The value to convert. - The type of the to convert. - Options to control the conversion behavior. - The which may be used to cancel the write operation. - Convert the provided value to UTF-8 encoded JSON text and write it to the . + The type of the value to convert. + Options to control serialization behavior. + A token that may be used to cancel the write operation. + Asynchronously converts the value of a specified type to UTF-8 encoded JSON text and writes it to the specified stream. A task that represents the asynchronous write operation. To be added. @@ -564,12 +538,12 @@ Using a is not as efficient as using UTF-8 encoding since t - To be added. - The UTF-8 to write to. + The type of the value to serialize. + The UTF-8 stream to write to. The value to convert. - Options to control the conversion behavior. - The which may be used to cancel the write operation. - Convert the provided value to UTF-8 encoded JSON text and write it to the . + Options to control serialization behavior. + A token that may be used to cancel the write operation. + Asynchronously converts a value of a type specified by a generic type parametaer to UTF-8 encoded JSON text and writes it to a stream. A task that represents the asynchronous write operation. To be added. @@ -595,9 +569,9 @@ Using a is not as efficient as using UTF-8 encoding since t The value to convert. - The type of the to convert. + The type of the value to convert. Options to control the conversion behavior. - Convert the provided value into a array. + Converts a value of the specified type into a UTF8-encoded byte array. A UTF-8 representation of the value. To be added. @@ -624,13 +598,13 @@ Using a is not as efficient as using UTF-8 encoding since t - To be added. + The type of the value. The value to convert. Options to control the conversion behavior. - Convert the provided value into a array. + Converts the value of a type specifed by a generic type parameter into a UTF8-encoded byte array. A UTF-8 representation of the value. To be added. - \ No newline at end of file + From 19df3f7c9d4160b82c968b77e6947fc282d59ac4 Mon Sep 17 00:00:00 2001 From: Ron Petrusha Date: Thu, 1 Aug 2019 08:54:12 -0700 Subject: [PATCH 3/3] Added dropped-out text to fix broken xref. --- xml/System.Text.Json/JsonSerializer.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xml/System.Text.Json/JsonSerializer.xml b/xml/System.Text.Json/JsonSerializer.xml index bc785eb8246..72955df3727 100644 --- a/xml/System.Text.Json/JsonSerializer.xml +++ b/xml/System.Text.Json/JsonSerializer.xml @@ -255,7 +255,7 @@ Upon completion of this method, `reader` will be positioned at the final token i This method makes a copy of the data the reader acted on, so there is no caller requirement to maintain data integrity beyond the return of this method. -The used to create the instance of the take precedence over the when they conflict. Hence, , are used while reading. +The used to create the instance of the take precedence over the when they conflict. Hence, , , and are used while reading. ]]>