We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8b96f9e commit a359702Copy full SHA for a359702
crates/vespera_macro/src/lib.rs
@@ -248,7 +248,13 @@ pub fn vespera(input: TokenStream) -> TokenStream {
248
}
249
};
250
for openapi_file_name in &openapi_file_names {
251
- if let Err(e) = std::fs::write(openapi_file_name, &json_str) {
+ // create directory if not exists
252
+ let file_path = Path::new(openapi_file_name);
253
+ if let Some(parent) = file_path.parent() {
254
+ std::fs::create_dir_all(parent).expect("Failed to create parent directory");
255
+ }
256
+
257
+ if let Err(e) = std::fs::write(file_path, &json_str) {
258
return syn::Error::new(
259
Span::call_site(),
260
format!(
0 commit comments