Skip to content

Commit 26e9dbf

Browse files
authored
Add note about order of JSON objects (#27383)
1 parent 6040994 commit 26e9dbf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

docs/standard/serialization/system-text-json-converters-how-to.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,9 @@ Suppose, for example, you have a `Person` abstract base class, with `Employee` a
332332

333333
The following code shows a base class, two derived classes, and a custom converter for them. The converter uses a discriminator property to do polymorphic deserialization. The type discriminator isn't in the class definitions but is created during serialization and is read during deserialization.
334334

335+
> [!IMPORTANT]
336+
> The example code requires JSON object name/value pairs to stay in order, which is not a standard requirement of JSON.
337+
335338
:::code language="csharp" source="snippets/system-text-json-how-to/csharp/Person.cs" id="Person":::
336339

337340
:::code language="csharp" source="snippets/system-text-json-how-to/csharp/PersonConverterWithTypeDiscriminator.cs":::

0 commit comments

Comments
 (0)