@@ -20,13 +20,17 @@ pub struct Cli {
20
20
#[ argh( option, default = "SchemaFlavor::All" ) ]
21
21
pub flavor : SchemaFlavor ,
22
22
23
- /// add enum descriptions to property descriptions [default = true]
24
- #[ argh( option, default = "true" ) ]
25
- pub lift_enum_descriptions : bool ,
26
-
27
23
/// generate only this namespace (can be repeated)
28
24
#[ argh( option) ]
29
25
pub namespace : Vec < String > ,
26
+
27
+ /// add enum descriptions to property descriptions [default = true]
28
+ #[ argh( switch) ]
29
+ pub lift_enum_descriptions : bool ,
30
+
31
+ /// merge endpoints with multiple paths into a single OpenAPI operation [default = false]
32
+ #[ argh( switch) ]
33
+ pub merge_multipath_endpoints : bool ,
30
34
}
31
35
32
36
use derive_more:: FromStr ;
@@ -42,20 +46,21 @@ pub enum SchemaFlavor {
42
46
}
43
47
44
48
impl From < Cli > for Configuration {
45
- fn from ( val : Cli ) -> Configuration {
46
- let flavor = match val . flavor {
49
+ fn from ( cli : Cli ) -> Configuration {
50
+ let flavor = match cli . flavor {
47
51
SchemaFlavor :: All => None ,
48
52
SchemaFlavor :: Serverless => Some ( Flavor :: Serverless ) ,
49
53
SchemaFlavor :: Stack => Some ( Flavor :: Stack ) ,
50
54
} ;
51
55
52
56
Configuration {
53
57
flavor,
54
- lift_enum_descriptions : val. lift_enum_descriptions ,
55
- namespaces : if val. namespace . is_empty ( ) {
58
+ lift_enum_descriptions : cli. lift_enum_descriptions ,
59
+ merge_multipath_endpoints : cli. merge_multipath_endpoints ,
60
+ namespaces : if cli. namespace . is_empty ( ) {
56
61
None
57
62
} else {
58
- Some ( val . namespace )
63
+ Some ( cli . namespace )
59
64
} ,
60
65
}
61
66
}
0 commit comments