Skip to content

Conversation

@DSingh0304
Copy link
Contributor

@DSingh0304 DSingh0304 commented Jan 2, 2026

Why submit this pull request?

  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches

What changes will this PR take into?

Fields with empty object values ({}) were being silently dropped when saving. This affects:

  • Plugins that don't require configuration (e.g., key-auth, prometheus, echo)
  • Upstream discovery_args when using Service Discovery

Root Cause: The fast-clean library used in src/utils/producer.ts has emptyObjectsCleaner: true by default, which removes empty objects before sending data to the server.

Fix: Set emptyObjectsCleaner: false in the deepCleanEmptyKeys function to preserve empty objects.

Related issues

Checklist:

  • 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?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

- Add SchemaForm component that renders forms from JSON Schema
- Support for oneOf (conditional field groups)
- Support for dependencies (conditional fields based on other values)
- Reuses existing FormItem components (TextInput, Select, Switch, NumberInput)
- Add demo page at /schema_form_demo for testing
Instead of globally disabling emptyObjectsCleaner which broke timeout
validation, this fix uses a marker-based approach that only preserves
empty objects in the plugins field. Other empty objects (like timeout)
are still cleaned as expected.

- Add producePreservePlugins to mark empty plugin configs before cleaning
- Add produceRemovePreserveMarkers to restore them after cleaning
- This prevents both bugs: plugins being dropped AND invalid timeout errors
@DSingh0304 DSingh0304 force-pushed the fix/empty-plugin-config branch from 5bc28d4 to e2d8f6c Compare January 6, 2026 07:09
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this form? It seems irrelevant to the title

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes my bad, the branch i created tracked one of my other branches which was for another issue. Sorry for the confusion I will raise a new PR by creating a new branch.

@DSingh0304 DSingh0304 closed this Jan 8, 2026
@DSingh0304 DSingh0304 deleted the fix/empty-plugin-config branch January 8, 2026 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants