@@ -20,13 +20,17 @@ pub struct Cli {
2020 #[ argh( option, default = "SchemaFlavor::All" ) ]
2121 pub flavor : SchemaFlavor ,
2222
23- /// add enum descriptions to property descriptions [default = true]
24- #[ argh( option, default = "true" ) ]
25- pub lift_enum_descriptions : bool ,
26-
2723 /// generate only this namespace (can be repeated)
2824 #[ argh( option) ]
2925 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 ,
3034}
3135
3236use derive_more:: FromStr ;
@@ -42,20 +46,21 @@ pub enum SchemaFlavor {
4246}
4347
4448impl 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 {
4751 SchemaFlavor :: All => None ,
4852 SchemaFlavor :: Serverless => Some ( Flavor :: Serverless ) ,
4953 SchemaFlavor :: Stack => Some ( Flavor :: Stack ) ,
5054 } ;
5155
5256 Configuration {
5357 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 ( ) {
5661 None
5762 } else {
58- Some ( val . namespace )
63+ Some ( cli . namespace )
5964 } ,
6065 }
6166 }
0 commit comments