@@ -222,9 +222,19 @@ async fn create_model_schema_entry_internal(
222222 path. push ( model. file_path . as_str ( ) ) ;
223223 path. pop ( ) ;
224224
225+ let mut path = PathBuf :: from ( & project_root) ;
226+ path. push ( model. file_path . as_str ( ) ) ;
227+ let file = path. file_stem ( ) . ok_or ( "Failed to get file stem" ) ?;
228+
225229 // Make the schema.yaml file be in there
226- let mut schema_path = path. clone ( ) ;
227- schema_path. push ( "schema.yaml" ) ;
230+ let mut schema_path = PathBuf :: from ( & project_root) ;
231+ schema_path. push ( model. file_path . as_str ( ) ) ;
232+ schema_path. pop ( ) ;
233+ schema_path. push ( format ! (
234+ "{}.yaml" ,
235+ file. to_str( )
236+ . ok_or( "Failed to convert file stem to string" ) ?
237+ ) ) ;
228238 let string_schema_path = schema_path
229239 . to_str ( )
230240 . ok_or ( "Failed to convert path to string" ) ?
@@ -1943,7 +1953,7 @@ models:
19431953 . unwrap ( ) ;
19441954
19451955 let binding = written_files. borrow ( ) ;
1946- let updated_content = binding. get ( & "models/schema .yaml" . to_string ( ) ) . unwrap ( ) ;
1956+ let updated_content = binding. get ( & "models/shifts .yaml" . to_string ( ) ) . unwrap ( ) ;
19471957
19481958 assert_eq ! (
19491959 updated_content,
@@ -1976,11 +1986,7 @@ models:
19761986 "models/schema.yaml" . to_string( ) ,
19771987 quary_proto:: File {
19781988 name: "models/schema.yaml" . to_string( ) ,
1979- contents: prost:: bytes:: Bytes :: from(
1980- "
1981- models:
1982- " ,
1983- ) ,
1989+ contents: prost:: bytes:: Bytes :: from( "" ) ,
19841990 } ,
19851991 ) ,
19861992 ]
@@ -1999,7 +2005,7 @@ models:
19992005 . unwrap ( ) ;
20002006
20012007 let binding = written_files. borrow ( ) ;
2002- let updated_content = binding. get ( & "models/schema .yaml" . to_string ( ) ) . unwrap ( ) ;
2008+ let updated_content = binding. get ( & "models/shifts .yaml" . to_string ( ) ) . unwrap ( ) ;
20032009
20042010 assert_eq ! (
20052011 updated_content,
0 commit comments