Skip to content
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

Add optional __path__ and __required__ fields in Config deserialization #25

Merged
merged 2 commits into from
Dec 4, 2023

Conversation

fuzzypixelz
Copy link
Member

Fixes #19.

The issue stems from Config denying unknown fields such as __path__ and __required__. As this data is (currently) unused by Web Server, 'deserializing' it into serde::de::IgnoredAny is the most straightforward solution.

Note that other Zenoh plugins such as zenoh-plugin-dds do deserialize these fields, but IIUC they do not use them afterwards. If true, I will open a PR to mark them as IgnoredAny in all plugins.

@JEnoch
Copy link
Member

JEnoch commented Nov 23, 2023

Thanks for addressing this forgotten issue!

I think that even if not used yet, those fields can be useful, and at least displayed in the admin space.
They shall be consistent with the description made in DEFAULT_CONFIG.json5 and with the code reading them in commons/zenoh-config/src/lib.rs. Thus, they shall be defined as such:

    __path__: Option<bool>,
    __required__: Option<Vec<String>>,

And I see their definitions are not consistent across plugins. See:

Could you please open PR for those ?

@fuzzypixelz fuzzypixelz changed the title Ignore thr __path__ and __required__ fields in Config deserialization Add optional __path__ and __required__ fields in Config deserialization Nov 29, 2023
Copy link
Member

@JEnoch JEnoch left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

[Bug] Plugin loading failure using zenohd -P webserver
2 participants