From 65790d42b8e38805ecd48ec40c697bb1e10e1371 Mon Sep 17 00:00:00 2001
From: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
Date: Fri, 18 Oct 2024 08:39:08 -0700
Subject: [PATCH 1/3] Fix typo and para tags (#10584)
---
.../JsonPropertyInfo.xml | 55 ++++++-------------
1 file changed, 16 insertions(+), 39 deletions(-)
diff --git a/xml/System.Text.Json.Serialization.Metadata/JsonPropertyInfo.xml b/xml/System.Text.Json.Serialization.Metadata/JsonPropertyInfo.xml
index bc8e694da66..a9dd98058ca 100644
--- a/xml/System.Text.Json.Serialization.Metadata/JsonPropertyInfo.xml
+++ b/xml/System.Text.Json.Serialization.Metadata/JsonPropertyInfo.xml
@@ -56,11 +56,8 @@
Gets the constructor parameter associated with the current property.
To be added.
- Returns the metadata for the parameter in the
- deserialization constructor that has been associated with the current property.
- A constructor parameter is matched to a property or field if they are of the
- same type and have the same name, up to case insensitivity. Each constructor
- parameter must be matched to exactly one property of field.
+ Returns the metadata for the parameter in the deserialization constructor that has been associated with the current property.
+ A constructor parameter is matched to a property or field if they are of the same type and have the same (case-insensitive) name. Each constructor parameter must be matched to exactly one property or field.
@@ -94,11 +91,9 @@
## Remarks
-When resolving metadata via , this property
- will be populated with the underlying of the serialized property or field.
+When resolving metadata via or , this property will be populated with the underlying of the serialized property or field.
-Setting a custom attribute provider has no impact on the contract model
- but serves as metadata for downstream contract modifiers.
+Setting a custom attribute provider has no impact on the contract model but serves as metadata for downstream contract modifiers.
]]>
@@ -135,10 +130,9 @@ Setting a custom attribute provider has no impact on the contract model
## Remarks
-It is possible to use instances with this property.
+It's possible to use instances with this property.
-For contracts originating from , the value of
- will be mapped from annotations.
+For contracts originating from , the value of will be mapped from annotations.
]]>
@@ -225,10 +219,7 @@ Setting to `null` will result in the property being skipped on serialization.
or ,
- the value of this property will be mapped from annotations.
+For contracts originating from or , the value of this property will be mapped from annotations.
]]>
@@ -258,11 +249,8 @@ The current or ,
- derive the value of this property from nullable reference type annotations, including annotations
- from attributes such as or .
- This property has no effect on serialization unless the
- property has been enabled, in which case the serializer will reject any values returned by the getter.
+ Contracts originating from or , derive the value of this property from nullable reference type annotations, including annotations from attributes such as or .
+ This property has no effect on serialization unless the property has been enabled, in which case the serializer will reject any values returned by the getter.
The instance has been locked for further modification.
@@ -326,13 +314,9 @@ The `required` keyword is currently not supported in Gets or sets a value indicating whether the input type of the setter is annotated as nullable.
To be added.
- Contracts originating from or ,
- derive the value of this property from nullable reference type annotations, including annotations
- from attributes such as or .
- This property has no effect on deserialization unless the
- property has been enabled, in which case the serializer will reject any deserialization results.
- If the property has been associated with a deserialization constructor parameter,
- this setting reflected the nullability annotation of the parameter and not the property setter.
+ Contracts originating from or , derive the value of this property from nullable reference type annotations, including annotations from attributes such as or .
+ This property has no effect on deserialization unless the property has been enabled, in which case the serializer will reject any deserialization results.
+ If the property has been associated with a deserialization constructor parameter, this setting reflected the nullability annotation of the parameter and not the property setter.
The instance has been locked for further modification.
@@ -367,9 +351,7 @@ The `required` keyword is currently not supported in cannot conflict with that of other defined in the declaring .
-For contracts originating from or ,
- the value typically reflects the underlying .NET member name, the name derived from ,
- or the value specified in .
+For contracts originating from or , the value typically reflects the underlying .NET member name, the name derived from , or the value specified in .
]]>
@@ -400,10 +382,7 @@ For contracts originating from
or ,
- the value of this property will be mapped from annotations.
+For contracts originating from or , the value of this property will be mapped from annotations.
]]>
@@ -480,8 +459,7 @@ For contracts originating from or ,
- the value of this property will be mapped from annotations.
+For contracts originating from or , the value of this property will be mapped from annotations.
]]>
@@ -581,8 +559,7 @@ The first parameter denotes the parent object, and the second parameter denotes
Setting the predicate to `null` is equivalent to always serializing the property value.
-For contracts originating from ,
- the value of will map to this predicate.
+For contracts originating from , the value of will map to this predicate.
]]>
From 9193540faa762fafe20aa421fe4e65d67348ba20 Mon Sep 17 00:00:00 2001
From: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
Date: Fri, 18 Oct 2024 13:09:54 -0700
Subject: [PATCH 2/3] Fix displayed text (#10596)
---
xml/System.Text.Json.Serialization/JsonSourceGenerationMode.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xml/System.Text.Json.Serialization/JsonSourceGenerationMode.xml b/xml/System.Text.Json.Serialization/JsonSourceGenerationMode.xml
index 26917fed2bf..dca9cfbcd4d 100644
--- a/xml/System.Text.Json.Serialization/JsonSourceGenerationMode.xml
+++ b/xml/System.Text.Json.Serialization/JsonSourceGenerationMode.xml
@@ -44,7 +44,7 @@
0
- When specified on , indicates that both type-metadata initialization logic and optimized serialization logic should be generated for all types. When specified on , indicates that the setting on should be used.
+ When specified on JsonSourceGenerationOptionsAttribute.GenerationMode, indicates that both type-metadata initialization logic and optimized serialization logic should be generated for all types. When specified on JsonSerializableAttribute.GenerationMode, indicates that the setting on JsonSourceGenerationOptionsAttribute.GenerationMode should be used.
From e4006f01d78db7e36cfa43601e5493ec9327f5e1 Mon Sep 17 00:00:00 2001
From: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
Date: Fri, 18 Oct 2024 17:47:17 -0700
Subject: [PATCH 3/3] Add note about allowing out of order metadata properties
(#10587)
---
xml/System.Text.Json.Serialization/ReferenceHandler.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/xml/System.Text.Json.Serialization/ReferenceHandler.xml b/xml/System.Text.Json.Serialization/ReferenceHandler.xml
index 173c491372d..f667da9cf67 100644
--- a/xml/System.Text.Json.Serialization/ReferenceHandler.xml
+++ b/xml/System.Text.Json.Serialization/ReferenceHandler.xml
@@ -135,11 +135,11 @@
* For the metadata properties within the JSON to be considered well-formed, they must follow these rules:
- * The `$id` metadata property must be the first property in the JSON object.
+ * Unless is set to `true`, the `$id` metadata property must be the first property in the JSON object.
* A JSON object that contains a `$ref` metadata property must not contain any other properties.
* The value of the `$ref` metadata property must refer to an `$id` that has appeared earlier in the JSON.
* The value of the `$id` and `$ref` metadata properties must be a JSON string.
- * For enumerable types, such as , the JSON array must be nested within a JSON object containing an `$id` and `$values` metadata property, in that order.
+ * For enumerable types, such as , the JSON array must be nested within a JSON object containing an `$id` and `$values` metadata property, in that order. (However, the order is not important if is set to `true`.)
* For enumerable types, the `$values` metadata property must be a JSON array.
* The `$values` metadata property is only valid when referring to enumerable types.