From 8e7163b87f45c8e21ce09df5faeb092a9da48d49 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Thu, 17 Oct 2024 17:18:42 -0700 Subject: [PATCH] Add note about allowing out of order metadata properties --- 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.