-
Notifications
You must be signed in to change notification settings - Fork 68
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 openapi deserialize #70
Conversation
Thank you for the fix. The I'll do the merge once the transform mut changes are removed. |
Thank you for the review @Wicpar ! I've reverted the commit with compiler warnings fixes, so you can merge the deserialize fix. Now, during compilation there are warnings
Does marking these functions at least with I've checked warnings for methods /// A transform helper that wraps [`TransformPathItem`].
#[must_use]
pub struct TransformPathItem<'t> {
pub(crate) hidden: bool,
pub(crate) path: &'t mut PathItem,
}
impl<'t> TransformPathItem<'t> {
/// Create a new transform helper.
pub fn new(path: &'t mut PathItem) -> Self {
Self {
hidden: false,
path,
}
}
/// Hide the path from the documentation.
///
/// This is taken into account by generators provided
/// by this library.
///
/// Hiding an item causes it to be ignored
/// completely, there is no way to restore or "unhide" it afterwards.
#[tracing::instrument(skip_all)]
pub fn hidden(mut self, hidden: bool) -> Self {
self.hidden = hidden;
self
}
/// Provide a summary for the path.
#[tracing::instrument(skip_all)]
pub fn summary(mut self, desc: &str) -> Self {
self.path.summary = Some(desc.into());
self
}
/// Provide a description for the path.
#[tracing::instrument(skip_all)]
pub fn description(mut self, desc: &str) -> Self {
self.path.description = Some(desc.into());
self
}
//... skipped
} It really doesn't need |
It's really odd, i may be wrong but a non mut parameter should not be assignable, even inner members unless there is an unsafe cell. Maybe self is an exception. |
Ah i see indeed it is a mut ref already, as you said. Somehow i didn't see that. I'll merge the mut changes too |
f040f7c
to
27029a1
Compare
Hey @Wicpar I've returned the original commit for a cleaner commit history, so you can merge all changes. |
openapi
field type from'&static str
toCow<'static, str>
for the relaxing requirement for deserialized data (actual for the case when you trying to deserialize data which not previously statically included in your binary)