-
Notifications
You must be signed in to change notification settings - Fork 117
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 optional type aliases #272
Conversation
if p.path.segments.len() == 1 && &ty.ident == "Option" { | ||
is_required = false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is certainly not what I expected in code. I guess you can't always remember how the code evolves.
core/src/v2/schema.rs
Outdated
@@ -312,6 +316,10 @@ impl<T> Apiv2Schema for Option<T> { | |||
default fn security_scheme() -> Option<SecurityScheme> { | |||
None | |||
} | |||
|
|||
fn is_required() -> bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this a constant? It's a primitive value after all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :)
One last thing. Can you add/modify a test for it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Fix #257