Commit ffb3c0f
authored
Relax JSON encoding in System.ClientModel (Azure#50885)
The default encoding rules used by Utf8JsonWriter are very strict, more than what's needed just for JSON, under the assumption that the resulting JSON might be embedded in an HTML page / script element. That strictness is not necessary or desirable when JSON is just being sent as part of an application/json payload, as it is with API inputs/outputs. The stricter encoding rules can have measurable impact, especially with the kinds of payloads commonly used in these APIs, e.g. base64 includes '+' in its alphabet, and '+' is a character that's encoded in the strict mode and not in the relaxed mode.
This PR relaxes the encoding rules used.1 parent 5caa16f commit ffb3c0f
File tree
2 files changed
+4
-2
lines changed- sdk/core/System.ClientModel/src/ModelReaderWriter
2 files changed
+4
-2
lines changedLines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | | - | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
0 commit comments