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

Cond attribute does not support arbitrary types #523

Open
p-lindberg opened this issue Jan 31, 2025 · 0 comments
Open

Cond attribute does not support arbitrary types #523

p-lindberg opened this issue Jan 31, 2025 · 0 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@p-lindberg
Copy link

The cond attribute appears to only work with Option fields, at least when dealing with custom types. It seems reasonable to assume that any type that implements Default should support conditional parsing. Also, there's no indication that the cond attribute is not doing anything for these types - we only realised this after carefully going through the trace logs.

Switching from cond = "expression" to skip, cond = "!expression" instead seems to give the expected result for arbitrary types.

@sharksforarms sharksforarms added documentation Improvements or additions to documentation enhancement New feature or request labels Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants