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

Mandatory omit a field if some other field equals some value #780

Open
2 tasks done
vishal1132 opened this issue Jun 7, 2021 · 3 comments
Open
2 tasks done

Mandatory omit a field if some other field equals some value #780

vishal1132 opened this issue Jun 7, 2021 · 3 comments

Comments

@vishal1132
Copy link

  • I have looked at the documentation here first?
  • I have looked at the examples provided that may showcase my question here?

Package version eg. v9, v10:

v10.4.0

Issue, Question or Enhancement:

Mandatory omit a field if some other field is present in the struct already.

Code sample, to showcase or reproduce:

For example-

type A struct{
    B string  
    C string
}

C should definitely not be there if B equals something like "abcd"

@Nikachev
Copy link
Contributor

The excluded_if tag is needed, as opposed to required_if.

@johnnybubonic
Copy link
Contributor

Hello, is excluded_if implemented at all? I am unable to find it in the documentation nor in the source.

@jh125486
Copy link
Contributor

I've added a PR against with #847.

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

No branches or pull requests

4 participants