Commit d2a3a60
committed
Fix empty state field in /api/deprecated-features/used endpoint
The /api/deprecated-features/used endpoint was returning an empty
state field in the JSON response. This was a regression introduced
in #14229, which added the state field to show whether deprecated
features are permitted or denied.
The issue was that rabbit_depr_ff_extra:cli_info0/1 always tried to
extract the state field with a default empty string, even when
rabbit_deprecated_features:list(used) doesn't include a state
field (unlike list(all) which does).
This commit fixes the issue by only including the state field when
it exists in the feature properties, using maps:find/2 and maps:merge/2
to conditionally add it.
The fix ensures that:
- /api/deprecated-features returns state field with valid values
- /api/deprecated-features/used omits the state field entirely
Tests are updated to verify this behavior.
GitHub issue: #143401 parent 037c9eb commit d2a3a60
File tree
2 files changed
+15
-9
lines changed- deps
- rabbitmq_management/test
- rabbit/src
2 files changed
+15
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | 61 | | |
63 | 62 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
70 | 73 | | |
71 | 74 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4218 | 4218 | | |
4219 | 4219 | | |
4220 | 4220 | | |
4221 | | - | |
| 4221 | + | |
| 4222 | + | |
| 4223 | + | |
4222 | 4224 | | |
4223 | 4225 | | |
4224 | 4226 | | |
| |||
4239 | 4241 | | |
4240 | 4242 | | |
4241 | 4243 | | |
4242 | | - | |
| 4244 | + | |
| 4245 | + | |
4243 | 4246 | | |
4244 | 4247 | | |
4245 | 4248 | | |
| |||
0 commit comments