Skip to content

Commit 8245711

Browse files
authored
Revise AI example (#49914)
1 parent 5aa08cc commit 8245711

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/standard/serialization/system-text-json/deserialization.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ To deserialize from UTF-8, call a <xref:System.Text.Json.JsonSerializer.Deserial
8989

9090
## Use AI to deserialize JSON
9191

92-
You can use AI tools, such as GitHub Copilot, to generate code that uses `System.Text.Json` to deserialize from JSON. You can customize the prompt to use a JSON string with property names and values that suit your requirements.
92+
You can use AI tools, such as GitHub Copilot, to generate code that uses `System.Text.Json` to deserialize from JSON. For example, you can customize the prompt to demonstrate deserialization when the target class defines a property that's missing from the JSON input.
9393

9494
The following text shows an example prompt for Copilot Chat:
9595

9696
```copilot-prompt
97-
Generate code to use System.Text.Json to deserialize a JSON string {"FirstName":"John","LastName":"Doe","Age":30} to an equivalent .NET object.
98-
Map property names & values.
97+
Generate C# code to use System.Text.Json to deserialize a JSON string {"FirstName":"John","LastName":"Doe"} to an equivalent .NET object, where the class defines an Age property.
98+
Show what happens when the JSON is missing a property defined in the class.
9999
Provide example output.
100100
```
101101

@@ -106,4 +106,4 @@ For more information about GitHub Copilot, see GitHub's [FAQs](https://github.co
106106
## See also
107107

108108
- [GitHub Copilot in Visual Studio](/visualstudio/ide/visual-studio-github-copilot-install-and-states)
109-
- [GitHub Copilot in VS Code](https://code.visualstudio.com/docs/copilot/overview)
109+
- [GitHub Copilot in Visual Studio Code](https://code.visualstudio.com/docs/copilot/overview)

0 commit comments

Comments
 (0)