Commit 83e39b6
committed
mango: correct behavior of
The `fields` attribute on `_explain` might have the string value
`"all_fields"` when the respective query parameter (`fields`) is
not set by the user. This is to express that no projection of
fields would happen on the returned documents.
The current behavior contradicts with the current contract,
because by documentation, `fields` is an array of strings instead
to provide information on the projected fields. The discrepancy
here makes it hard to formalize this in OpenAPI which leads to
problems in the development of SDKs, among others.
Change `_explain` to return `[]` for `fields` when it was not set
through the query parameters. This is thought to be semantically
equivalent to `"all_fields"` therefore this would not cause
problems while preserving the promised type.
Thanks @ricellis for reporting this problem!fields on _explain
1 parent f79d951 commit 83e39b6
2 files changed
+13
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1401 | 1401 | | |
1402 | 1402 | | |
1403 | 1403 | | |
1404 | | - | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
1405 | 1407 | | |
1406 | 1408 | | |
1407 | 1409 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
297 | | - | |
| 297 | + | |
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
312 | | - | |
| 312 | + | |
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| |||
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
335 | 340 | | |
336 | 341 | | |
337 | 342 | | |
| |||
1091 | 1096 | | |
1092 | 1097 | | |
1093 | 1098 | | |
1094 | | - | |
1095 | 1099 | | |
1096 | 1100 | | |
1097 | 1101 | | |
| |||
1110 | 1114 | | |
1111 | 1115 | | |
1112 | 1116 | | |
1113 | | - | |
| 1117 | + | |
1114 | 1118 | | |
1115 | 1119 | | |
1116 | 1120 | | |
| |||
1123 | 1127 | | |
1124 | 1128 | | |
1125 | 1129 | | |
1126 | | - | |
| 1130 | + | |
1127 | 1131 | | |
1128 | 1132 | | |
1129 | 1133 | | |
| |||
1140 | 1144 | | |
1141 | 1145 | | |
1142 | 1146 | | |
1143 | | - | |
| 1147 | + | |
1144 | 1148 | | |
1145 | 1149 | | |
1146 | 1150 | | |
| |||
0 commit comments