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

Add support for repeated schema(...) definition #410

Merged
merged 1 commit into from
Dec 11, 2022

Conversation

juhaku
Copy link
Owner

@juhaku juhaku commented Dec 11, 2022

Add support for ToSchema types to have repeated definition of schema(...) attribute. Prior to this PR only the first #[schema(...)] attribute was taken in account in parsing the attributes for variant / field / type. This commit will add support for repeated definition of the attribute.

 #[derive(ToSchema)]
 struct UserName {
     #[schema(min_length = 5)]
     #[schema(max_length = 10)]
     name: String,
 }

Add support for `ToSchema` types to have repeated definition of
`schema(...)` attribute. Prior to this PR only the first
`#[schema(...)]` attribute was taken in account in parsing the
attributes for variant / field / type. This commit will add support for
repeated definition of the attribute.
```rust
 #[derive(ToSchema)]
 struct UserName {
     #[schema(min_length = 5)]
     #[schema(max_length = 10)]
     name: String,
 }
```
@juhaku juhaku merged commit 1af2443 into master Dec 11, 2022
@juhaku juhaku deleted the feature-repeated-schema branch December 11, 2022 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Released
Development

Successfully merging this pull request may close these issues.

1 participant