DSingh0304 opened a new pull request, #3272:
URL: https://github.com/apache/apisix-dashboard/pull/3272
**Why submit this pull request?**
- [x] Bugfix
- [ ] New feature provided
- [ ] Improve performance
- [ ] Backport patches
**What changes will this PR take into?**
Plugins that don't require configuration (e.g., `key-auth`, `prometheus`,
`echo`) were being silently dropped when saving routes.
**Root Cause:** The `fast-clean` library used in
[src/utils/producer.ts](cci:7://file:///home/deep/Desktop/Code/Organizations/apisix-dashboard/src/utils/producer.ts:0:0-0:0)
has `emptyObjectsCleaner: true` by default, which removes empty objects. When
a plugin is added without any configuration, it's stored as `{ "plugin-name":
{} }`. The empty `{}` was being cleaned out, effectively removing the plugin.
**Fix:** Set `emptyObjectsCleaner: false` in the
[deepCleanEmptyKeys](cci:1://file:///home/deep/Desktop/Code/Organizations/apisix-dashboard/src/utils/producer.ts:22:0-31:5)
function to preserve empty objects, ensuring plugins with no required
configuration are saved correctly.
**Related issues**
fix #3269
**Checklist:**
- [x] Did you explain what problem does this PR solve? Or what new features
have been added?
- [ ] Have you added corresponding test cases?
- [ ] Have you modified the corresponding document?
- [x] Is this PR backward compatible? If it is not backward compatible,
please discuss on the mailing list first
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]