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

Fix respect required attribute #863

Merged
merged 2 commits into from
Aug 13, 2024
Merged

Conversation

chrislearn
Copy link
Member

Merge from utoipa: juhaku/utoipa#990

Prior to this PR the required attribute was not correctly respected in
all cases. This was due to the fact that the required attribute had the
same weight with the default rule that is checked from the option and some
other serde attributes. Even this works in most cases but lacks control
over explicitly defining required to false when type is not
optional.

This PR fixes this by making clear separation between the default rule
and the manual required attribute with preference on the manually
defined required attribute.

@chrislearn chrislearn merged commit 050fbbb into salvo-rs:main Aug 13, 2024
5 checks passed
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.

1 participant