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

feat: add option for missing field #398

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

goyzhang
Copy link

@goyzhang goyzhang commented Oct 1, 2023

Add DisallowMissingField option to create error when a field of a struct is missing.

Remark:
This solves the issue that the validator can't handle: when a int type is absent in the yaml, the validator has no way to find out as it checks against go structs.

I would add this to strict() but didn't, as it would cause a breaking change.

see #397

Add DisallowMissingField option to create error when a field of a struct
is missing.

Remark:
This solves the issue that the validator can't handle: when a int type
is absent in the yaml, the validator has no way to find out as it checks
against go structs.
@goyzhang goyzhang force-pushed the feat/add-disallowmissingfield branch from 0036c30 to 8de587e Compare October 1, 2023 02:29
@codecov-commenter
Copy link

Codecov Report

Merging #398 (8de587e) into master (0640a15) will increase coverage by 0.08%.
The diff coverage is 100.00%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #398      +/-   ##
==========================================
+ Coverage   76.02%   76.10%   +0.08%     
==========================================
  Files          13       13              
  Lines        4692     4708      +16     
==========================================
+ Hits         3567     3583      +16     
  Misses        866      866              
  Partials      259      259              

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants