Commit 16529da
committed
Fix: Core abilities invalid schemas (has examples and returns empty array intested of object).
This commit fixes two issues with the core abilities schemas we have:
- They have examples on the schema with is not complient with the version draft-04 of schema JSON we are using.
- The top level defaults are defined as an empty array and they are of type object, but a php empty array gets JSON serialized and returned in the rest API as [] instead of {}, causing problems on the client validation.
Developed in #10510.
Props jorgefilipecosta, gziolo.
Fixes #64252.
git-svn-id: https://develop.svn.wordpress.org/branches/6.9@61252 602fd350-edb4-49c9-b593-d223f7449a821 parent bb440d1 commit 16529da
File tree
2 files changed
+23
-3
lines changed- src/wp-includes
- rest-api/endpoints
2 files changed
+23
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
224 | 223 | | |
225 | 224 | | |
226 | 225 | | |
| |||
Lines changed: 23 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
197 | 218 | | |
198 | 219 | | |
199 | 220 | | |
| |||
209 | 230 | | |
210 | 231 | | |
211 | 232 | | |
212 | | - | |
213 | | - | |
| 233 | + | |
| 234 | + | |
214 | 235 | | |
215 | 236 | | |
216 | 237 | | |
| |||
0 commit comments