Commit 9c4cbf2
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)1 parent b821635 commit 9c4cbf2
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 | |
|---|---|---|---|
| |||
4228 | 4228 | | |
4229 | 4229 | | |
4230 | 4230 | | |
4231 | | - | |
| 4231 | + | |
| 4232 | + | |
| 4233 | + | |
4232 | 4234 | | |
4233 | 4235 | | |
4234 | 4236 | | |
| |||
4249 | 4251 | | |
4250 | 4252 | | |
4251 | 4253 | | |
4252 | | - | |
| 4254 | + | |
| 4255 | + | |
4253 | 4256 | | |
4254 | 4257 | | |
4255 | 4258 | | |
| |||
0 commit comments