Commit 520fe4c
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: #14340
(cherry picked from commit d2a3a60)
(cherry picked from commit 9c4cbf2)1 parent a952738 commit 520fe4c
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 | |
|---|---|---|---|
| |||
4148 | 4148 | | |
4149 | 4149 | | |
4150 | 4150 | | |
4151 | | - | |
| 4151 | + | |
| 4152 | + | |
| 4153 | + | |
4152 | 4154 | | |
4153 | 4155 | | |
4154 | 4156 | | |
| |||
4169 | 4171 | | |
4170 | 4172 | | |
4171 | 4173 | | |
4172 | | - | |
| 4174 | + | |
| 4175 | + | |
4173 | 4176 | | |
4174 | 4177 | | |
4175 | 4178 | | |
| |||
0 commit comments