Skip to content

Feat: support validate struct without struct tag#934

Merged
deankarn merged 1 commit intogo-playground:masterfrom
leoliang1997:dev/add-struct-without-tag-support
May 1, 2022
Merged

Feat: support validate struct without struct tag#934
deankarn merged 1 commit intogo-playground:masterfrom
leoliang1997:dev/add-struct-without-tag-support

Conversation

@leoliang1997
Copy link
Copy Markdown
Contributor

@leoliang1997 leoliang1997 commented Apr 20, 2022

Fixes Or Enhances

validate struct without struct tag, use map[string]string to define rules, ref: #853

Make sure that you've checked the boxes below before you submit PR:

  • Tests exist or have been written that cover this particular change.

@go-playground/validator-maintainers

@leoliang1997 leoliang1997 requested a review from a team as a code owner April 20, 2022 11:10
@coveralls
Copy link
Copy Markdown

coveralls commented Apr 20, 2022

Coverage Status

Coverage decreased (-0.1%) to 75.034% when pulling adfb118 on leoliang1997:dev/add-struct-without-tag-support into 58d5778 on go-playground:master.

@leoliang1997 leoliang1997 force-pushed the dev/add-struct-without-tag-support branch from 1d01768 to adfb118 Compare April 21, 2022 03:11
Copy link
Copy Markdown
Contributor

@deankarn deankarn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool just one ask.

Comment thread validator_instance.go
}
}

// RegisterStructValidationMapRules registers validate map rules
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some addition information regarding that rules override any tags at the struct level?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I can add it.

@deankarn deankarn merged commit d0d0c35 into go-playground:master May 1, 2022
@leoliang1997 leoliang1997 deleted the dev/add-struct-without-tag-support branch May 3, 2022 13:14
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

Successfully merging this pull request may close these issues.

3 participants