Skip to content

Commit

Permalink
Add note about allowing out of order metadata properties (#10587)
Browse files Browse the repository at this point in the history
  • Loading branch information
gewarren authored Oct 19, 2024
1 parent 9193540 commit e4006f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xml/System.Text.Json.Serialization/ReferenceHandler.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <xref:System.Text.Json.JsonSerializerOptions.AllowOutOfOrderMetadataProperties> 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 <xref:System.Collections.Generic.List%601>, 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 <xref:System.Collections.Generic.List%601>, 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 <xref:System.Text.Json.JsonSerializerOptions.AllowOutOfOrderMetadataProperties> 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.
Expand Down

0 comments on commit e4006f0

Please sign in to comment.