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

consider default name when validating #6

Closed
caarlos0 opened this issue Nov 23, 2021 · 2 comments
Closed

consider default name when validating #6

caarlos0 opened this issue Nov 23, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@caarlos0
Copy link

caarlos0 commented Nov 23, 2021

Hey! Thanks for this, amazing project!

I have a small issue which I think other people will have as well, for instance, consider this struct:

type Foo struct {
  Foo string `yaml:",omitempty"`
  Bar string `yaml:"notBar"`
}

If I validate it using snake case, both fields should fail, as the first will be, by default Foo and the second one is in camel case.

Would be nice if either the default name is considered or if we could disallow not naming the field.

Cheers!

@ldez
Copy link
Owner

ldez commented Nov 23, 2021

Hello,

I think I understand the use case, I will try to add a new option for this.

@ldez
Copy link
Owner

ldez commented Jan 3, 2022

Fixed by 7b21925

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

No branches or pull requests

2 participants