Commit 1d1f122
Add CreateJson overloads to BinaryContent for simplified JSON serialization (Azure#50921)
* Initial plan
* Add CreateJson overloads to BinaryContent
Co-authored-by: KrzysztofCwalina <[email protected]>
* Add MediaType property to BinaryContent and consolidate tests
Co-authored-by: KrzysztofCwalina <[email protected]>
* Remove JsonBinaryContent class and use regular Create method
Co-authored-by: KrzysztofCwalina <[email protected]>
* Changes before error encountered
Co-authored-by: KrzysztofCwalina <[email protected]>
* Add MediaType verification to CreateJson tests and address reviewer feedback
Co-authored-by: KrzysztofCwalina <[email protected]>
* Update API surface files after adding CreateJson methods and MediaType property
Co-authored-by: KrzysztofCwalina <[email protected]>
* Fix MediaType property for ModelBinaryContent when model is serialized as JSON
- Added logic to set MediaType to "application/json" when model will be serialized as JSON format
- This applies to both IPersistableModel and IJsonModel implementations that return "J" format
- Updated tests to verify MediaType is correctly set for model-based BinaryContent
- Addresses reviewer feedback about missing MediaType for JSON-serialized models
Co-authored-by: KrzysztofCwalina <[email protected]>
* Add CreateJson(string) overload to BinaryContent for raw JSON strings
Co-authored-by: jsquire <[email protected]>
* Add optional validation parameter to CreateJson(string) overload
Co-authored-by: KrzysztofCwalina <[email protected]>
* Add AOT compliance attributes to CreateJson methods to resolve CI warnings
Co-authored-by: KrzysztofCwalina <[email protected]>
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: KrzysztofCwalina <[email protected]>
Co-authored-by: jsquire <[email protected]>1 parent adb8cb2 commit 1d1f122
File tree
4 files changed
+300
-1
lines changed- sdk/core/System.ClientModel
- api
- src/Message
- tests/Message
4 files changed
+300
-1
lines changedLines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
27 | 32 | | |
28 | 33 | | |
29 | 34 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
27 | 31 | | |
28 | 32 | | |
29 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| |||
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
20 | 30 | | |
21 | 31 | | |
22 | 32 | | |
| |||
65 | 75 | | |
66 | 76 | | |
67 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
68 | 163 | | |
69 | 164 | | |
70 | 165 | | |
| |||
96 | 191 | | |
97 | 192 | | |
98 | 193 | | |
99 | | - | |
| 194 | + | |
100 | 195 | | |
101 | 196 | | |
| 197 | + | |
102 | 198 | | |
103 | 199 | | |
104 | 200 | | |
| |||
140 | 236 | | |
141 | 237 | | |
142 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
143 | 247 | | |
144 | 248 | | |
145 | 249 | | |
| |||
0 commit comments