File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 1111//! See the [examples](https://github.com/tamasfe/aide/tree/master/examples)
1212//! to see how Aide is used with various frameworks.
1313//!
14- //! Currently only Open API version `3.1.0 ` is supported.
14+ //! Currently only Open API version `3.1.x ` is supported.
1515//!
1616//! Previous releases of aide relied heavily on macros, and the
1717//! [`linkme`](https://docs.rs/linkme/latest/linkme/) crate for automagic global state.
Original file line number Diff line number Diff line change @@ -112,9 +112,13 @@ mod serde_version {
112112 pub ( super ) fn deserialize < ' de , D : Deserializer < ' de > > (
113113 de : D ,
114114 ) -> Result < Cow < ' static , str > , D :: Error > {
115- <& ' de str >:: deserialize ( de) . and_then ( |s| match s == "3.1.0" {
116- true => Ok ( Cow :: Owned ( "3.1.0" . to_owned ( ) ) ) ,
117- false => Err ( serde:: de:: Error :: custom ( "expected 3.1.0" ) ) ,
115+ // Accept any patch version of 3.1.x.
116+ <& ' de str >:: deserialize ( de) . and_then ( |s| {
117+ if s. starts_with ( "3.1." ) {
118+ Ok ( Cow :: Owned ( "3.1.0" . to_owned ( ) ) )
119+ } else {
120+ Err ( serde:: de:: Error :: custom ( "expected 3.1.x" ) )
121+ }
118122 } )
119123 }
120124}
You can’t perform that action at this time.
0 commit comments