@@ -222,9 +222,19 @@ async fn create_model_schema_entry_internal(
222
222
path. push ( model. file_path . as_str ( ) ) ;
223
223
path. pop ( ) ;
224
224
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
+
225
229
// 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
+ ) ) ;
228
238
let string_schema_path = schema_path
229
239
. to_str ( )
230
240
. ok_or ( "Failed to convert path to string" ) ?
@@ -1943,7 +1953,7 @@ models:
1943
1953
. unwrap ( ) ;
1944
1954
1945
1955
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 ( ) ;
1947
1957
1948
1958
assert_eq ! (
1949
1959
updated_content,
@@ -1976,11 +1986,7 @@ models:
1976
1986
"models/schema.yaml" . to_string( ) ,
1977
1987
quary_proto:: File {
1978
1988
name: "models/schema.yaml" . to_string( ) ,
1979
- contents: prost:: bytes:: Bytes :: from(
1980
- "
1981
- models:
1982
- " ,
1983
- ) ,
1989
+ contents: prost:: bytes:: Bytes :: from( "" ) ,
1984
1990
} ,
1985
1991
) ,
1986
1992
]
@@ -1999,7 +2005,7 @@ models:
1999
2005
. unwrap ( ) ;
2000
2006
2001
2007
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 ( ) ;
2003
2009
2004
2010
assert_eq ! (
2005
2011
updated_content,
0 commit comments