Skip to content

feat: ignore unknown configuration fileds #460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gabrik
Copy link
Contributor

@gabrik gabrik commented Mar 13, 2025

This PR changes the behavior of the configuration parser to ignore unknown fields.
This allows to load the DDS plugin multiple times, and thus to connect to multiple DDS domains at once.
See how to load a plugin multiple times in Zenoh: eclipse-zenoh/zenoh#1060

Signed-off-by: Gabriele Baldoni <gabriele.baldoni@gmail.com>
@gabrik gabrik added the enhancement New feature or request label Mar 13, 2025
@gabrik gabrik requested a review from sashacmc March 13, 2025 07:06
@gabrik gabrik self-assigned this Mar 13, 2025
@JEnoch
Copy link
Member

JEnoch commented Mar 13, 2025

The drawback of this change will be that a typo in the config will be silently ignored. This could lead to lot of confusions.

@gabrik
Copy link
Contributor Author

gabrik commented Mar 13, 2025

The drawback of this change will be that a typo in the config will be silently ignored. This could lead to lot of confusions.

I agree, but I did not find a way to let serde emit a warn when the field is not known.

Another solution can be to remove all the fields like __<something>__ before passing the configuration to plugins.
But this needs to be done in Zenoh code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants