You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/client-concepts/serialization/custom-serialization.asciidoc
+9-11
Original file line number
Diff line number
Diff line change
@@ -1,22 +1,21 @@
1
1
[[custom-serialization]]
2
-
=== Custom Serialization
2
+
====Custom serialization
3
3
4
4
The built-in source serializer handles most POCO document models correctly. Sometimes, you may need further control over how your types are serialized.
5
5
6
6
NOTE: The built-in source serializer uses the Microsoft https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/overview[`System.Text.Json` library] internally. You can apply `System.Text.Json` attributes and converters to control serialization of your document types.
7
7
8
8
[[system-text-json-attributes]]
9
-
==== Using System.Text.Json attributes
9
+
===== Using `System.Text.Json` attributes
10
10
11
11
`System.Text.Json` includes attributes that can be applied to types and properties to control how they are serialized. These can be applied to your POCO document types to perform actions such as controlling the name of a property, or ignoring a property entirely. Visit the https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/overview[Microsoft documentation for further examples].
12
12
13
13
We can model a document to represent data about a person using a regular class (POCO), applying `System.Text.Json`` attributes as necessary.
The index request is serialized, with the source serializer handling the `Person` type, serializing the POCO property named `FirstName` to the JSON object member named `forename`. The `Age` property is ignored and does not appear in the JSON.
@@ -40,17 +38,17 @@ The index request is serialized, with the source serializer handling the `Person
0 commit comments