File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
compiler-rs/clients_schema_to_rest_api_spec/src Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change 11use argh:: FromArgs ;
22use clients_schema:: IndexedModel ;
33use clients_schema_to_rest_api_spec:: convert_schema_to_individual_files;
4- use std:: fs:: { create_dir_all , File } ;
4+ use std:: fs;
55use tracing:: Level ;
66use tracing_subscriber:: fmt:: format:: FmtSpan ;
77use tracing_subscriber:: FmtSubscriber ;
@@ -36,22 +36,17 @@ fn main() -> anyhow::Result<()> {
3636 tracing:: subscriber:: set_global_default ( subscriber) ?;
3737
3838 tracing:: info!( "Reading schema from {}" , cli. input) ;
39-
40- // Read and parse the input schema
41- let input_file = File :: open ( & cli. input ) ?;
39+ let input_file = fs:: File :: open ( & cli. input ) ?;
4240 let indexed_model: IndexedModel = serde_json:: from_reader ( input_file) ?;
4341
4442 tracing:: info!( "Converting schema to rest-api-spec format" ) ;
4543
4644 // Create output directory if it doesn't exist
47- create_dir_all ( & cli. output_dir ) ?;
48-
49- // Convert the schema to individual files
50- convert_schema_to_individual_files ( indexed_model, & cli. output_dir ) ?;
45+ fs:: create_dir_all ( & cli. output_dir ) ?;
5146
5247 tracing:: info!( "Writing individual API files to {}" , cli. output_dir) ;
48+ convert_schema_to_individual_files ( indexed_model, & cli. output_dir ) ?;
5349
5450 tracing:: info!( "Conversion completed successfully" ) ;
55-
5651 Ok ( ( ) )
5752}
You can’t perform that action at this time.
0 commit comments