fix: preserve plugins with empty config using targeted approach#3277
Open
DSingh0304 wants to merge 4 commits intoapache:masterfrom
Open
fix: preserve plugins with empty config using targeted approach#3277DSingh0304 wants to merge 4 commits intoapache:masterfrom
DSingh0304 wants to merge 4 commits intoapache:masterfrom
Conversation
This introduces a targeted fix to preserve empty plugin configurations (like key-auth) during the data cleaning process. - Adds producePreservePlugins to mark empty plugin configs before cleaning - Adds produceRemovePreserveMarkers to restore them after cleaning - Keeps default cleaning behavior for other fields to prevent validation errors
SkyeYoung
reviewed
Jan 12, 2026
Member
There was a problem hiding this comment.
Hi, pls add a test for this case.
Contributor
Author
There was a problem hiding this comment.
Yes i will add the test in some time.
Contributor
Author
There was a problem hiding this comment.
Hey I have added the test...
Baoyuantop
reviewed
Jan 22, 2026
Contributor
Baoyuantop
left a comment
There was a problem hiding this comment.
The PR description also mentions fixing #3270
We also need to write tests to verify this issue.
Comment on lines
34
to
47
|
|
||
| // Create a route via API with key-auth plugin having empty configuration | ||
| const response = await postRouteReq(e2eReq, { | ||
| name: routeNameWithEmptyPlugin, | ||
| uri: routeUri, | ||
| plugins: { | ||
| 'key-auth': {}, | ||
| }, | ||
| upstream: { | ||
| nodes: [{ host: 'httpbin.org', port: 80, weight: 1 }], | ||
| type: 'roundrobin', | ||
| }, | ||
| }); | ||
|
|
Contributor
There was a problem hiding this comment.
I believe this is also part of the testing path and should be created within the testing process rather than through the API.
Contributor
Author
There was a problem hiding this comment.
Oh okay I ll look into it..
SkyeYoung
approved these changes
Jan 27, 2026
Contributor
Author
I will add it soon... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why submit this pull request?
What changes will this PR take into?
Fields with empty object values (
{}) were being silently dropped when saving. This affects:key-auth,prometheus,echo)discovery_argswhen using Service DiscoveryRoot Cause: The
fast-cleanlibrary used in src/utils/producer.ts hasemptyObjectsCleaner: trueby default, which removes empty objects before sending data to the server.Fix: Set
emptyObjectsCleaner: falsein the deepCleanEmptyKeys function to preserve empty objects.Related issues
fix #3269
fix #3270
Checklist: