Commit a057ebf 1 parent c39c9ba commit a057ebf Copy full SHA for a057ebf
File tree 2 files changed +19
-1
lines changed
2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,23 @@ pub struct PathItem {
44
44
pub extensions : IndexMap < String , serde_json:: Value > ,
45
45
}
46
46
47
+ impl PathItem {
48
+ pub fn iter ( & self ) -> impl Iterator < Item = & Operation > + ' _ {
49
+ vec ! [
50
+ & self . get,
51
+ & self . put,
52
+ & self . post,
53
+ & self . delete,
54
+ & self . options,
55
+ & self . head,
56
+ & self . patch,
57
+ & self . trace,
58
+ ]
59
+ . into_iter ( )
60
+ . flat_map ( Option :: iter)
61
+ }
62
+ }
63
+
47
64
/// Holds the relative paths to the individual endpoints and
48
65
/// their operations. The path is appended to the URL from the
49
66
/// Server Object in order to construct the full URL. The Paths
Original file line number Diff line number Diff line change @@ -269,8 +269,9 @@ fn test_operation_extension_docs() {
269
269
. iter ( )
270
270
. filter_map ( |( _, i) | match i {
271
271
ReferenceOr :: Reference { .. } => None ,
272
- ReferenceOr :: Item ( item) => item . get . as_ref ( ) ,
272
+ ReferenceOr :: Item ( item) => Some ( item ) ,
273
273
} )
274
+ . flat_map ( |item| item. iter ( ) )
274
275
. flat_map ( |o| o. extensions . iter ( ) . filter ( |e| !e. 0 . starts_with ( "x-" ) ) )
275
276
. collect :: < Vec < _ > > ( ) ;
276
277
You can’t perform that action at this time.
0 commit comments