From 15d9885fa0302ca23c96f5247c853ebb8dcbff7c Mon Sep 17 00:00:00 2001
From: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
Date: Fri, 15 Sep 2023 18:37:11 +0100
Subject: [PATCH 1/2] Add missing STJ xml docs

---
 .../src/System/BinaryDataConverter.cs         |  6 +++
 .../src/CompatibilitySuppressions.xml         | 48 +++++++++++++++++++
 .../src/System/Text/Json/Nodes/JsonArray.cs   |  3 +-
 .../src/System/Text/Json/Nodes/JsonNode.cs    |  1 +
 .../JsonObjectCreationHandlingAttribute.cs    |  5 ++
 .../JsonUnmappedMemberHandlingAttribute.cs    |  5 ++
 .../Serialization/JsonConverterFactory.cs     |  1 +
 .../Json/Serialization/JsonConverterOfT.cs    |  1 +
 .../Serialization/JsonNumberEnumConverter.cs  |  5 ++
 .../JsonSerializer.Read.Document.cs           |  1 +
 10 files changed, 75 insertions(+), 1 deletion(-)

diff --git a/src/libraries/System.Memory.Data/src/System/BinaryDataConverter.cs b/src/libraries/System.Memory.Data/src/System/BinaryDataConverter.cs
index aa144e0622b3de..f4c78399fa8195 100644
--- a/src/libraries/System.Memory.Data/src/System/BinaryDataConverter.cs
+++ b/src/libraries/System.Memory.Data/src/System/BinaryDataConverter.cs
@@ -8,6 +8,12 @@ namespace System.Text.Json.Serialization
     /// </summary>
     public sealed class BinaryDataJsonConverter : JsonConverter<BinaryData>
     {
+        /// <summary>
+        /// Initializes a new instance of the <see cref="BinaryDataJsonConverter"/>.
+        /// </summary>
+        public BinaryDataJsonConverter()
+        { }
+
         /// <inheritdoc/>
         public override BinaryData? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
         {
diff --git a/src/libraries/System.Text.Json/src/CompatibilitySuppressions.xml b/src/libraries/System.Text.Json/src/CompatibilitySuppressions.xml
index 59676209362345..6d4b54c1fd405b 100644
--- a/src/libraries/System.Text.Json/src/CompatibilitySuppressions.xml
+++ b/src/libraries/System.Text.Json/src/CompatibilitySuppressions.xml
@@ -57,6 +57,54 @@
     <Right>lib/netstandard2.0/System.Text.Json.dll</Right>
     <IsBaselineSuppression>true</IsBaselineSuppression>
   </Suppression>
+  <Suppression>
+    <DiagnosticId>CP0002</DiagnosticId>
+    <Target>M:System.Text.Json.Serialization.JsonObjectCreationHandlingAttribute.#ctor</Target>
+    <Left>ref/net462/System.Text.Json.dll</Left>
+    <Right>lib/net462/System.Text.Json.dll</Right>
+  </Suppression>
+  <Suppression>
+    <DiagnosticId>CP0002</DiagnosticId>
+    <Target>M:System.Text.Json.Serialization.JsonUnmappedMemberHandlingAttribute.#ctor</Target>
+    <Left>ref/net462/System.Text.Json.dll</Left>
+    <Right>lib/net462/System.Text.Json.dll</Right>
+  </Suppression>
+  <Suppression>
+    <DiagnosticId>CP0002</DiagnosticId>
+    <Target>M:System.Text.Json.Serialization.JsonObjectCreationHandlingAttribute.#ctor</Target>
+    <Left>ref/net8.0/System.Text.Json.dll</Left>
+    <Right>lib/net8.0/System.Text.Json.dll</Right>
+  </Suppression>
+  <Suppression>
+    <DiagnosticId>CP0002</DiagnosticId>
+    <Target>M:System.Text.Json.Serialization.JsonUnmappedMemberHandlingAttribute.#ctor</Target>
+    <Left>ref/net8.0/System.Text.Json.dll</Left>
+    <Right>lib/net8.0/System.Text.Json.dll</Right>
+  </Suppression>
+  <Suppression>
+    <DiagnosticId>CP0002</DiagnosticId>
+    <Target>M:System.Text.Json.Serialization.JsonObjectCreationHandlingAttribute.#ctor</Target>
+    <Left>ref/net9.0/System.Text.Json.dll</Left>
+    <Right>lib/net9.0/System.Text.Json.dll</Right>
+  </Suppression>
+  <Suppression>
+    <DiagnosticId>CP0002</DiagnosticId>
+    <Target>M:System.Text.Json.Serialization.JsonUnmappedMemberHandlingAttribute.#ctor</Target>
+    <Left>ref/net9.0/System.Text.Json.dll</Left>
+    <Right>lib/net9.0/System.Text.Json.dll</Right>
+  </Suppression>
+  <Suppression>
+    <DiagnosticId>CP0002</DiagnosticId>
+    <Target>M:System.Text.Json.Serialization.JsonObjectCreationHandlingAttribute.#ctor</Target>
+    <Left>ref/netstandard2.0/System.Text.Json.dll</Left>
+    <Right>lib/netstandard2.0/System.Text.Json.dll</Right>
+  </Suppression>
+  <Suppression>
+    <DiagnosticId>CP0002</DiagnosticId>
+    <Target>M:System.Text.Json.Serialization.JsonUnmappedMemberHandlingAttribute.#ctor</Target>
+    <Left>ref/netstandard2.0/System.Text.Json.dll</Left>
+    <Right>lib/netstandard2.0/System.Text.Json.dll</Right>
+  </Suppression>
   <Suppression>
     <DiagnosticId>CP0014</DiagnosticId>
     <Target>M:System.Text.Json.JsonSerializerOptions.AddContext``1:[T:System.ObsoleteAttribute]</Target>
diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonArray.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonArray.cs
index 8dc0924ad36e61..9ae40a15ea66f6 100644
--- a/src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonArray.cs
+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonArray.cs
@@ -113,9 +113,10 @@ internal int GetElementIndex(JsonNode? node)
         }
 
         /// <summary>
-        /// Returns enumerator that wraps calls to <see cref="JsonNode.GetValue{T}"/>.
+        /// Returns an enumerable that wraps calls to <see cref="JsonNode.GetValue{T}"/>.
         /// </summary>
         /// <typeparam name="T">The type of the value to obtain from the <see cref="JsonValue"/>.</typeparam>
+        /// <returns>An enumerable iterating over values of the array.</returns>
         public IEnumerable<T> GetValues<T>()
         {
             foreach (JsonNode? item in List)
diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonNode.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonNode.cs
index a06fc47cfc1c42..1d38e494da611c 100644
--- a/src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonNode.cs
+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonNode.cs
@@ -242,6 +242,7 @@ public JsonNode? this[string propertyName]
         /// <summary>
         /// Creates a new instance of the <see cref="JsonNode"/>. All children nodes are recursively cloned.
         /// </summary>
+        /// <returns>A new cloned instance of the current node.</returns>
         public JsonNode DeepClone() => DeepCloneCore();
 
         internal abstract JsonNode DeepCloneCore();
diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonObjectCreationHandlingAttribute.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonObjectCreationHandlingAttribute.cs
index 718bdc744b6854..bb7d800d7a43ca 100644
--- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonObjectCreationHandlingAttribute.cs
+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonObjectCreationHandlingAttribute.cs
@@ -31,6 +31,11 @@ namespace System.Text.Json.Serialization;
 [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, AllowMultiple = false)]
 public sealed class JsonObjectCreationHandlingAttribute : JsonAttribute
 {
+    /// <summary>
+    /// Initializes a new instance of <see cref="JsonObjectCreationHandlingAttribute"/>.
+    /// </summary>
+    public JsonObjectCreationHandlingAttribute() { }
+
     /// <summary>
     /// Indicates what configuration should be used when deserializing members.
     /// </summary>
diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonUnmappedMemberHandlingAttribute.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonUnmappedMemberHandlingAttribute.cs
index 6004ea91d82ed3..01d33a3131d06e 100644
--- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonUnmappedMemberHandlingAttribute.cs
+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonUnmappedMemberHandlingAttribute.cs
@@ -11,6 +11,11 @@ namespace System.Text.Json.Serialization
         AllowMultiple = false, Inherited = false)]
     public class JsonUnmappedMemberHandlingAttribute : JsonAttribute
     {
+        /// <summary>
+        /// Initializes a new instance of <see cref="JsonUnmappedMemberHandlingAttribute"/>.
+        /// </summary>
+        public JsonUnmappedMemberHandlingAttribute() { }
+
         /// <summary>
         /// Initializes a new instance of <see cref="JsonUnmappedMemberHandlingAttribute"/>.
         /// </summary>
diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterFactory.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterFactory.cs
index 973d3692f2d8f3..7537fa0d833be2 100644
--- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterFactory.cs
+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterFactory.cs
@@ -142,6 +142,7 @@ internal sealed override void WriteAsPropertyNameAsObject(Utf8JsonWriter writer,
             throw new InvalidOperationException();
         }
 
+        /// <inheritdoc/>
         public sealed override Type? Type => null;
 
         internal sealed override void WriteAsPropertyNameCoreAsObject(
diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.cs
index 490d8349ed8ef5..cbe509480f36df 100644
--- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.cs
+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.cs
@@ -498,6 +498,7 @@ internal bool TryWriteDataExtensionProperty(Utf8JsonWriter writer, T value, Json
             return success;
         }
 
+        /// <inheritdoc/>
         public sealed override Type Type { get; } = typeof(T);
 
         internal void VerifyRead(JsonTokenType tokenType, int depth, long bytesConsumed, bool isValueConverter, ref Utf8JsonReader reader)
diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonNumberEnumConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonNumberEnumConverter.cs
index f2c41af4dbefc0..fa7c190f4f3ea1 100644
--- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonNumberEnumConverter.cs
+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonNumberEnumConverter.cs
@@ -17,6 +17,11 @@ namespace System.Text.Json.Serialization
     public sealed class JsonNumberEnumConverter<TEnum> : JsonConverterFactory
         where TEnum : struct, Enum
     {
+        /// <summary>
+        /// Initializes a new instance of <see cref="JsonNumberEnumConverter{TEnum}"/>.
+        /// </summary>
+        public JsonNumberEnumConverter() { }
+
         /// <inheritdoc />
         public override bool CanConvert(Type typeToConvert) => typeToConvert == typeof(TEnum);
 
diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.Document.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.Document.cs
index 5d47b54b022177..8f7aefcbc30a3c 100644
--- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.Document.cs
+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.Document.cs
@@ -113,6 +113,7 @@ public static partial class JsonSerializer
         /// </summary>
         /// <param name="document">The <see cref="JsonDocument"/> to convert.</param>
         /// <param name="jsonTypeInfo">Metadata about the type to convert.</param>
+        /// <returns>A <paramref name="jsonTypeInfo"/> representation of the JSON value.</returns>
         /// <exception cref="System.ArgumentNullException">
         /// <paramref name="document"/> is <see langword="null"/>.
         ///

From bbbd63e2ae954e48d23f80ac9a4ed55540c408fe Mon Sep 17 00:00:00 2001
From: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
Date: Fri, 15 Sep 2023 19:35:35 +0100
Subject: [PATCH 2/2] fix docs and remove suppressions

---
 .../src/CompatibilitySuppressions.xml         | 48 -------------------
 .../JsonObjectCreationHandlingAttribute.cs    |  6 +--
 .../JsonUnmappedMemberHandlingAttribute.cs    |  6 +--
 3 files changed, 2 insertions(+), 58 deletions(-)

diff --git a/src/libraries/System.Text.Json/src/CompatibilitySuppressions.xml b/src/libraries/System.Text.Json/src/CompatibilitySuppressions.xml
index 6d4b54c1fd405b..59676209362345 100644
--- a/src/libraries/System.Text.Json/src/CompatibilitySuppressions.xml
+++ b/src/libraries/System.Text.Json/src/CompatibilitySuppressions.xml
@@ -57,54 +57,6 @@
     <Right>lib/netstandard2.0/System.Text.Json.dll</Right>
     <IsBaselineSuppression>true</IsBaselineSuppression>
   </Suppression>
-  <Suppression>
-    <DiagnosticId>CP0002</DiagnosticId>
-    <Target>M:System.Text.Json.Serialization.JsonObjectCreationHandlingAttribute.#ctor</Target>
-    <Left>ref/net462/System.Text.Json.dll</Left>
-    <Right>lib/net462/System.Text.Json.dll</Right>
-  </Suppression>
-  <Suppression>
-    <DiagnosticId>CP0002</DiagnosticId>
-    <Target>M:System.Text.Json.Serialization.JsonUnmappedMemberHandlingAttribute.#ctor</Target>
-    <Left>ref/net462/System.Text.Json.dll</Left>
-    <Right>lib/net462/System.Text.Json.dll</Right>
-  </Suppression>
-  <Suppression>
-    <DiagnosticId>CP0002</DiagnosticId>
-    <Target>M:System.Text.Json.Serialization.JsonObjectCreationHandlingAttribute.#ctor</Target>
-    <Left>ref/net8.0/System.Text.Json.dll</Left>
-    <Right>lib/net8.0/System.Text.Json.dll</Right>
-  </Suppression>
-  <Suppression>
-    <DiagnosticId>CP0002</DiagnosticId>
-    <Target>M:System.Text.Json.Serialization.JsonUnmappedMemberHandlingAttribute.#ctor</Target>
-    <Left>ref/net8.0/System.Text.Json.dll</Left>
-    <Right>lib/net8.0/System.Text.Json.dll</Right>
-  </Suppression>
-  <Suppression>
-    <DiagnosticId>CP0002</DiagnosticId>
-    <Target>M:System.Text.Json.Serialization.JsonObjectCreationHandlingAttribute.#ctor</Target>
-    <Left>ref/net9.0/System.Text.Json.dll</Left>
-    <Right>lib/net9.0/System.Text.Json.dll</Right>
-  </Suppression>
-  <Suppression>
-    <DiagnosticId>CP0002</DiagnosticId>
-    <Target>M:System.Text.Json.Serialization.JsonUnmappedMemberHandlingAttribute.#ctor</Target>
-    <Left>ref/net9.0/System.Text.Json.dll</Left>
-    <Right>lib/net9.0/System.Text.Json.dll</Right>
-  </Suppression>
-  <Suppression>
-    <DiagnosticId>CP0002</DiagnosticId>
-    <Target>M:System.Text.Json.Serialization.JsonObjectCreationHandlingAttribute.#ctor</Target>
-    <Left>ref/netstandard2.0/System.Text.Json.dll</Left>
-    <Right>lib/netstandard2.0/System.Text.Json.dll</Right>
-  </Suppression>
-  <Suppression>
-    <DiagnosticId>CP0002</DiagnosticId>
-    <Target>M:System.Text.Json.Serialization.JsonUnmappedMemberHandlingAttribute.#ctor</Target>
-    <Left>ref/netstandard2.0/System.Text.Json.dll</Left>
-    <Right>lib/netstandard2.0/System.Text.Json.dll</Right>
-  </Suppression>
   <Suppression>
     <DiagnosticId>CP0014</DiagnosticId>
     <Target>M:System.Text.Json.JsonSerializerOptions.AddContext``1:[T:System.ObsoleteAttribute]</Target>
diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonObjectCreationHandlingAttribute.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonObjectCreationHandlingAttribute.cs
index bb7d800d7a43ca..7f8a0cbe740cf8 100644
--- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonObjectCreationHandlingAttribute.cs
+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonObjectCreationHandlingAttribute.cs
@@ -31,11 +31,6 @@ namespace System.Text.Json.Serialization;
 [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, AllowMultiple = false)]
 public sealed class JsonObjectCreationHandlingAttribute : JsonAttribute
 {
-    /// <summary>
-    /// Initializes a new instance of <see cref="JsonObjectCreationHandlingAttribute"/>.
-    /// </summary>
-    public JsonObjectCreationHandlingAttribute() { }
-
     /// <summary>
     /// Indicates what configuration should be used when deserializing members.
     /// </summary>
@@ -44,6 +39,7 @@ public JsonObjectCreationHandlingAttribute() { }
     /// <summary>
     /// Initializes a new instance of <see cref="JsonObjectCreationHandlingAttribute"/>.
     /// </summary>
+    /// <param name="handling">The handling to apply to the current member.</param>
     public JsonObjectCreationHandlingAttribute(JsonObjectCreationHandling handling)
     {
         if (!JsonSerializer.IsValidCreationHandlingValue(handling))
diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonUnmappedMemberHandlingAttribute.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonUnmappedMemberHandlingAttribute.cs
index 01d33a3131d06e..ef99a901ade987 100644
--- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonUnmappedMemberHandlingAttribute.cs
+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonUnmappedMemberHandlingAttribute.cs
@@ -14,11 +14,7 @@ public class JsonUnmappedMemberHandlingAttribute : JsonAttribute
         /// <summary>
         /// Initializes a new instance of <see cref="JsonUnmappedMemberHandlingAttribute"/>.
         /// </summary>
-        public JsonUnmappedMemberHandlingAttribute() { }
-
-        /// <summary>
-        /// Initializes a new instance of <see cref="JsonUnmappedMemberHandlingAttribute"/>.
-        /// </summary>
+        /// <param name="unmappedMemberHandling">The handling to apply to the current member.</param>
         public JsonUnmappedMemberHandlingAttribute(JsonUnmappedMemberHandling unmappedMemberHandling)
         {
             UnmappedMemberHandling = unmappedMemberHandling;
