From 8cb769c2a251d5658fc062658ad2c4a1639f6468 Mon Sep 17 00:00:00 2001 From: D1-3105 Date: Thu, 19 Feb 2026 06:46:35 +0300 Subject: [PATCH] fix slash issue --- api/handlers.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/handlers.go b/api/handlers.go index 6d601f3..d93e57a 100644 --- a/api/handlers.go +++ b/api/handlers.go @@ -86,6 +86,11 @@ func openapiExport(w http.ResponseWriter, r *http.Request) { slog.Info("Accepted a new schema: %s", fullSchema.Info.Title) fullPth := "./schemas/" + fullSchema.Info.Title + ".json" + if err = os.MkdirAll(filepath.Dir(fullPth), 0777); err != nil { + slog.Error("Error creating directory %s: %v", filepath.Dir(fullPth), err) + returnError(w, err) + return + } err = os.WriteFile(fullPth, jsonData, 0644) if err != nil {