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

Config recursive access is inconsistent #1519

Open
fuzzypixelz opened this issue Oct 8, 2024 · 0 comments
Open

Config recursive access is inconsistent #1519

fuzzypixelz opened this issue Oct 8, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@fuzzypixelz
Copy link
Member

Describe the bug

If config: zenoh::Config then config.insert_json5("transport/unicast/max_links:2") succeeds while config.insert_json5("connect/retry/period_init_ms:500") fails with Str(\"unknown key\").

This is because the connect/retry field is an Option of a struct while transport/unicast is simply a struct. validated_struct_macros doesn't allow using recursive accessors unless the target is a simple struct:

https://github.com/p-avital/validated-struct-macros-rs/blob/048537b0ce74a7c961857c6de43436325477ffac/src/lib.rs#L392-L411

https://github.com/p-avital/validated-struct-macros-rs/blob/048537b0ce74a7c961857c6de43436325477ffac/src/lib.rs#L37-L44

The workaround is to write config.insert_json5("connect/retry:{period_init_ms:500}")

To reproduce

N/A

System info

@fuzzypixelz fuzzypixelz added the bug Something isn't working label Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant