From 6f01cecc22211b8ce5a1c52713898f07ac4aa901 Mon Sep 17 00:00:00 2001 From: Christian Beutel <> Date: Thu, 21 Mar 2024 20:38:31 +0100 Subject: [PATCH] adds openAPI docs --- db/migrations/1711048519_updated_waypoints.go | 34 +++++++++++++++++++ db/migrations/1711048534_updated_waypoints.go | 34 +++++++++++++++++++ docs/api/wanderer.openapi.json | 1 + 3 files changed, 69 insertions(+) create mode 100644 db/migrations/1711048519_updated_waypoints.go create mode 100644 db/migrations/1711048534_updated_waypoints.go create mode 100644 docs/api/wanderer.openapi.json diff --git a/db/migrations/1711048519_updated_waypoints.go b/db/migrations/1711048519_updated_waypoints.go new file mode 100644 index 00000000..e3f198d2 --- /dev/null +++ b/db/migrations/1711048519_updated_waypoints.go @@ -0,0 +1,34 @@ +package migrations + +import ( + "github.com/pocketbase/dbx" + "github.com/pocketbase/pocketbase/daos" + m "github.com/pocketbase/pocketbase/migrations" + "github.com/pocketbase/pocketbase/tools/types" +) + +func init() { + m.Register(func(db dbx.Builder) error { + dao := daos.New(db); + + collection, err := dao.FindCollectionByNameOrId("goeo2ubp103rzp9") + if err != nil { + return err + } + + collection.ViewRule = types.Pointer("@request.auth.id != \"\" && (@collection.trails.waypoints.id ?= id && (@collection.trails.author = @request.auth.id || @collection.trails.public = true) || author = @request.auth.id)") + + return dao.SaveCollection(collection) + }, func(db dbx.Builder) error { + dao := daos.New(db); + + collection, err := dao.FindCollectionByNameOrId("goeo2ubp103rzp9") + if err != nil { + return err + } + + collection.ViewRule = types.Pointer("@request.auth.id != \"\" && @collection.trails.waypoints.id ?= id && (@collection.trails.author = @request.auth.id || @collection.trails.public = true)") + + return dao.SaveCollection(collection) + }) +} diff --git a/db/migrations/1711048534_updated_waypoints.go b/db/migrations/1711048534_updated_waypoints.go new file mode 100644 index 00000000..e4de96ed --- /dev/null +++ b/db/migrations/1711048534_updated_waypoints.go @@ -0,0 +1,34 @@ +package migrations + +import ( + "github.com/pocketbase/dbx" + "github.com/pocketbase/pocketbase/daos" + m "github.com/pocketbase/pocketbase/migrations" + "github.com/pocketbase/pocketbase/tools/types" +) + +func init() { + m.Register(func(db dbx.Builder) error { + dao := daos.New(db); + + collection, err := dao.FindCollectionByNameOrId("goeo2ubp103rzp9") + if err != nil { + return err + } + + collection.ListRule = types.Pointer("@request.auth.id != \"\" && (@collection.trails.waypoints.id ?= id && (@collection.trails.author = @request.auth.id || @collection.trails.public = true) || author = @request.auth.id)") + + return dao.SaveCollection(collection) + }, func(db dbx.Builder) error { + dao := daos.New(db); + + collection, err := dao.FindCollectionByNameOrId("goeo2ubp103rzp9") + if err != nil { + return err + } + + collection.ListRule = types.Pointer("@request.auth.id != \"\" && @collection.trails.waypoints.id ?= id && (@collection.trails.author = @request.auth.id || @collection.trails.public = true)") + + return dao.SaveCollection(collection) + }) +} diff --git a/docs/api/wanderer.openapi.json b/docs/api/wanderer.openapi.json new file mode 100644 index 00000000..a9e5ce59 --- /dev/null +++ b/docs/api/wanderer.openapi.json @@ -0,0 +1 @@ +{"openapi":"3.0.1","info":{"title":"wanderer","description":"","version":"1.0.0"},"tags":[],"paths":{"/category":{"get":{"summary":"list","deprecated":false,"description":"","tags":[],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"collectionId":{"type":"string"},"collectionName":{"type":"string"},"created":{"type":"string"},"id":{"type":"string"},"img":{"type":"string"},"name":{"type":"string"},"updated":{"type":"string"}},"required":["collectionId","collectionName","created","id","img","name","updated"]}}}}}},"security":[]}},"/trail/{id}/file":{"post":{"summary":"file","deprecated":false,"description":"","tags":[],"parameters":[{"name":"id","in":"path","description":"","required":true,"example":"","schema":{"type":"string"}},{"name":"Content-Type","in":"header","description":"","required":true,"example":"multipart/form-data","schema":{"type":"string"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"photos":{"format":"binary","type":"string"},"gpx":{"format":"binary","type":"string"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}},"security":[]}},"/user/{id}/file":{"post":{"summary":"file","deprecated":false,"description":"","tags":[],"parameters":[{"name":"id","in":"path","description":"","required":true,"example":"","schema":{"type":"string"}},{"name":"Content-Type","in":"header","description":"","required":true,"example":"multipart/form-data","schema":{"type":"string"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"avatar":{"format":"binary","type":"string"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}},"security":[]}},"/list/{id}/file":{"post":{"summary":"file","deprecated":false,"description":"","tags":[],"parameters":[{"name":"id","in":"path","description":"","required":true,"example":"","schema":{"type":"string"}},{"name":"Content-Type","in":"header","description":"","required":true,"example":"multipart/form-data","schema":{"type":"string"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"avatar":{"format":"binary","type":"string"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}},"security":[]}},"/waypoint/{id}":{"get":{"summary":"show","deprecated":false,"description":"","tags":[],"parameters":[{"name":"id","in":"path","description":"","required":true,"example":"","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"author":{"type":"string"},"collectionId":{"type":"string"},"collectionName":{"type":"string"},"created":{"type":"string"},"description":{"type":"string"},"icon":{"type":"string"},"id":{"type":"string"},"lat":{"type":"integer"},"lon":{"type":"integer"},"name":{"type":"string"},"photos":{"type":"array","items":{"type":"string"}},"updated":{"type":"string"}},"required":["author","collectionId","collectionName","created","description","icon","id","lat","lon","name","photos","updated"]}}}},"404":{"description":"Record Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"response":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]},"isAbort":{"type":"boolean"},"originalError":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"data":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]}},"required":["url","status","data"]},"name":{"type":"string"}},"required":["url","status","response","isAbort","originalError","name"]}}}}},"security":[]},"post":{"summary":"update","deprecated":false,"description":"","tags":[],"parameters":[{"name":"id","in":"path","description":"","required":true,"example":"","schema":{"type":"string"}},{"name":"Content-Type","in":"header","description":"","required":true,"example":"application/json","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"example":""}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"author":{"type":"string"},"collectionId":{"type":"string"},"collectionName":{"type":"string"},"created":{"type":"string"},"description":{"type":"string"},"icon":{"type":"string"},"id":{"type":"string"},"lat":{"type":"integer"},"lon":{"type":"integer"},"name":{"type":"string"},"photos":{"type":"array","items":{"type":"string"}},"updated":{"type":"string"}},"required":["author","collectionId","collectionName","created","description","icon","id","lat","lon","name","photos","updated"]}}}},"404":{"description":"Record Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"response":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]},"isAbort":{"type":"boolean"},"originalError":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"data":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]}},"required":["url","status","data"]},"name":{"type":"string"}},"required":["url","status","response","isAbort","originalError","name"]}}}}},"security":[]},"delete":{"summary":"delete","deprecated":false,"description":"","tags":[],"parameters":[{"name":"id","in":"path","description":"","required":true,"example":"","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"acknowledged":{"type":"boolean"}},"required":["acknowledged"]}}}},"404":{"description":"Record Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"response":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]},"isAbort":{"type":"boolean"},"originalError":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"data":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]}},"required":["url","status","data"]},"name":{"type":"string"}},"required":["url","status","response","isAbort","originalError","name"]}}}}},"security":[]}},"/summit-log/{id}":{"get":{"summary":"show","deprecated":false,"description":"","tags":[],"parameters":[{"name":"id","in":"path","description":"","required":true,"example":"","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"collectionId":{"type":"string"},"collectionName":{"type":"string"},"created":{"type":"string"},"date":{"type":"string"},"id":{"type":"string"},"text":{"type":"string"},"updated":{"type":"string"}},"required":["collectionId","collectionName","created","date","id","text","updated"]}}}},"404":{"description":"Record Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"response":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]},"isAbort":{"type":"boolean"},"originalError":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"data":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]}},"required":["url","status","data"]},"name":{"type":"string"}},"required":["url","status","response","isAbort","originalError","name"]}}}}},"security":[]},"post":{"summary":"update","deprecated":false,"description":"","tags":[],"parameters":[{"name":"id","in":"path","description":"","required":true,"example":"","schema":{"type":"string"}},{"name":"Content-Type","in":"header","description":"","required":true,"example":"application/json","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"example":""}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"collectionId":{"type":"string"},"collectionName":{"type":"string"},"created":{"type":"string"},"date":{"type":"string"},"id":{"type":"string"},"text":{"type":"string"},"updated":{"type":"string"}},"required":["collectionId","collectionName","created","date","id","text","updated"]}}}},"404":{"description":"Record Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"response":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]},"isAbort":{"type":"boolean"},"originalError":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"data":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]}},"required":["url","status","data"]},"name":{"type":"string"}},"required":["url","status","response","isAbort","originalError","name"]}}}}},"security":[]},"delete":{"summary":"delete","deprecated":false,"description":"","tags":[],"parameters":[{"name":"id","in":"path","description":"","required":true,"example":"","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"acknowledged":{"type":"boolean"}},"required":["acknowledged"]}}}},"404":{"description":"Record Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"response":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]},"isAbort":{"type":"boolean"},"originalError":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"data":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]}},"required":["url","status","data"]},"name":{"type":"string"}},"required":["url","status","response","isAbort","originalError","name"]}}}}},"security":[]}},"/auth/login":{"post":{"summary":"login","deprecated":false,"description":"","tags":[],"parameters":[{"name":"Content-Type","in":"header","description":"","required":true,"example":"application/json","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"}},"required":["username","password"]},"example":""}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"record":{"type":"object","properties":{"avatar":{"type":"string"},"collectionId":{"type":"string"},"collectionName":{"type":"string"},"created":{"type":"string"},"email":{"type":"string"},"emailVisibility":{"type":"boolean"},"id":{"type":"string"},"language":{"type":"string"},"location":{"type":"object","properties":{"lat":{"type":"number"},"lon":{"type":"number"},"name":{"type":"string"}},"required":["lat","lon","name"]},"token":{"type":"string"},"unit":{"type":"string"},"updated":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean"}},"required":["avatar","collectionId","collectionName","created","email","emailVisibility","id","language","location","token","unit","updated","username","verified"]},"token":{"type":"string"}},"required":["record","token"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"response":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]},"isAbort":{"type":"boolean"},"originalError":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"data":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]}},"required":["url","status","data"]},"name":{"type":"string"}},"required":["url","status","response","isAbort","originalError","name"]}}}}},"security":[]}},"/trail/{id}":{"get":{"summary":"show","deprecated":false,"description":"","tags":[],"parameters":[{"name":"id","in":"path","description":"","required":true,"example":"","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"author":{"type":"string"},"category":{"type":"string"},"collectionId":{"type":"string"},"collectionName":{"type":"string"},"created":{"type":"string"},"description":{"type":"string"},"difficulty":{"type":"string"},"distance":{"type":"integer"},"duration":{"type":"integer"},"elevation_gain":{"type":"integer"},"gpx":{"type":"string"},"id":{"type":"string"},"lat":{"type":"number"},"location":{"type":"string"},"lon":{"type":"number"},"name":{"type":"string"},"photos":{"type":"array","items":{"type":"string"}},"public":{"type":"boolean"},"summit_logs":{"type":"array","items":{"type":"string"}},"thumbnail":{"type":"integer"},"updated":{"type":"string"},"waypoints":{"type":"array","items":{"type":"string"}}},"required":["author","category","collectionId","collectionName","created","description","difficulty","distance","duration","elevation_gain","gpx","id","lat","location","lon","name","photos","public","summit_logs","thumbnail","updated","waypoints"]}}}},"404":{"description":"Record Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"response":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]},"isAbort":{"type":"boolean"},"originalError":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"data":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]}},"required":["url","status","data"]},"name":{"type":"string"}},"required":["url","status","response","isAbort","originalError","name"]}}}}},"security":[]},"post":{"summary":"update","deprecated":false,"description":"","tags":[],"parameters":[{"name":"id","in":"path","description":"","required":true,"example":"","schema":{"type":"string"}},{"name":"Content-Type","in":"header","description":"","required":true,"example":"application/json","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"example":""}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"author":{"type":"string"},"category":{"type":"string"},"collectionId":{"type":"string"},"collectionName":{"type":"string"},"created":{"type":"string"},"description":{"type":"string"},"difficulty":{"type":"string"},"distance":{"type":"integer"},"duration":{"type":"integer"},"elevation_gain":{"type":"integer"},"expand":{"type":"object","properties":{"category":{"type":"object","properties":{"collectionId":{"type":"string"},"collectionName":{"type":"string"},"created":{"type":"string"},"id":{"type":"string"},"img":{"type":"string"},"name":{"type":"string"},"updated":{"type":"string"}},"required":["collectionId","collectionName","created","id","img","name","updated"]},"waypoints":{"type":"array","items":{"type":"object","properties":{"author":{"type":"string"},"collectionId":{"type":"string"},"collectionName":{"type":"string"},"created":{"type":"string"},"description":{"type":"string"},"icon":{"type":"string"},"id":{"type":"string"},"lat":{"type":"number"},"lon":{"type":"number"},"name":{"type":"string"},"photos":{"type":"array","items":{"type":"string"}},"updated":{"type":"string"}},"required":["author","collectionId","collectionName","created","description","icon","id","lat","lon","name","photos","updated"]}}},"required":["category","waypoints"]},"gpx":{"type":"string"},"id":{"type":"string"},"lat":{"type":"number"},"location":{"type":"string"},"lon":{"type":"number"},"name":{"type":"string"},"photos":{"type":"array","items":{"type":"string"}},"public":{"type":"boolean"},"summit_logs":{"type":"array","items":{"type":"string"}},"thumbnail":{"type":"integer"},"updated":{"type":"string"},"waypoints":{"type":"array","items":{"type":"string"}}},"required":["author","category","collectionId","collectionName","created","description","difficulty","distance","duration","elevation_gain","expand","gpx","id","lat","location","lon","name","photos","public","summit_logs","thumbnail","updated","waypoints"]}}}},"404":{"description":"Record Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"response":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]},"isAbort":{"type":"boolean"},"originalError":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"data":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]}},"required":["url","status","data"]},"name":{"type":"string"}},"required":["url","status","response","isAbort","originalError","name"]}}}}},"security":[]},"delete":{"summary":"delete","deprecated":false,"description":"","tags":[],"parameters":[{"name":"id","in":"path","description":"","required":true,"example":"","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"acknowledged":{"type":"boolean"}},"required":["acknowledged"]}}}},"404":{"description":"Record Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"response":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]},"isAbort":{"type":"boolean"},"originalError":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"data":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]}},"required":["url","status","data"]},"name":{"type":"string"}},"required":["url","status","response","isAbort","originalError","name"]}}}}},"security":[]}},"/user/{id}":{"get":{"summary":"show","deprecated":false,"description":"","tags":[],"parameters":[{"name":"id","in":"path","description":"","required":true,"example":"","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"avatar":{"type":"string"},"collectionId":{"type":"string"},"collectionName":{"type":"string"},"created":{"type":"string"},"email":{"type":"string"},"emailVisibility":{"type":"boolean"},"id":{"type":"string"},"language":{"type":"string"},"location":{"type":"object","properties":{"lat":{"type":"number"},"lon":{"type":"number"},"name":{"type":"string"}},"required":["lat","lon","name"]},"token":{"type":"string"},"unit":{"type":"string"},"updated":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean"}},"required":["avatar","collectionId","collectionName","created","email","emailVisibility","id","language","location","token","unit","updated","username","verified"]}}}},"404":{"description":"Record Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"response":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]},"isAbort":{"type":"boolean"},"originalError":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"data":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]}},"required":["url","status","data"]},"name":{"type":"string"}},"required":["url","status","response","isAbort","originalError","name"]}}}}},"security":[]},"post":{"summary":"update","deprecated":false,"description":"","tags":[],"parameters":[{"name":"id","in":"path","description":"","required":true,"example":"","schema":{"type":"string"}},{"name":"Content-Type","in":"header","description":"","required":true,"example":"application/json","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{}},"example":""}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"avatar":{"type":"string"},"collectionId":{"type":"string"},"collectionName":{"type":"string"},"created":{"type":"string"},"email":{"type":"string"},"emailVisibility":{"type":"boolean"},"id":{"type":"string"},"language":{"type":"string"},"location":{"type":"object","properties":{"lat":{"type":"number"},"lon":{"type":"number"},"name":{"type":"string"}},"required":["lat","lon","name"]},"token":{"type":"string"},"unit":{"type":"string"},"updated":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean"}},"required":["avatar","collectionId","collectionName","created","email","emailVisibility","id","language","location","token","unit","updated","username","verified"]}}}},"404":{"description":"Record Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"response":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]},"isAbort":{"type":"boolean"},"originalError":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"data":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]}},"required":["url","status","data"]},"name":{"type":"string"}},"required":["url","status","response","isAbort","originalError","name"]}}}}},"security":[]},"delete":{"summary":"delete","deprecated":false,"description":"","tags":[],"parameters":[{"name":"id","in":"path","description":"","required":true,"example":"","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"acknowledged":{"type":"boolean"}},"required":["acknowledged"]}}}},"404":{"description":"Record Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"response":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]},"isAbort":{"type":"boolean"},"originalError":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"data":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]}},"required":["url","status","data"]},"name":{"type":"string"}},"required":["url","status","response","isAbort","originalError","name"]}}}}},"security":[]}},"/list/{id}":{"get":{"summary":"show","deprecated":false,"description":"","tags":[],"parameters":[{"name":"id","in":"path","description":"","required":true,"example":"","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}},"security":[]},"post":{"summary":"update","deprecated":false,"description":"","tags":[],"parameters":[{"name":"id","in":"path","description":"","required":true,"example":"","schema":{"type":"string"}},{"name":"Content-Type","in":"header","description":"","required":true,"example":"application/json","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"example":""}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"author":{"type":"string"},"avatar":{"type":"string"},"collectionId":{"type":"string"},"collectionName":{"type":"string"},"created":{"type":"string"},"description":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"trails":{"type":"array","items":{"type":"string"}},"updated":{"type":"string"}},"required":["author","avatar","collectionId","collectionName","created","description","id","name","trails","updated"]}}}},"404":{"description":"Record Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"response":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]},"isAbort":{"type":"boolean"},"originalError":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"data":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]}},"required":["url","status","data"]},"name":{"type":"string"}},"required":["url","status","response","isAbort","originalError","name"]}}}}},"security":[]},"delete":{"summary":"delete","deprecated":false,"description":"","tags":[],"parameters":[{"name":"id","in":"path","description":"","required":true,"example":"","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"acknowledged":{"type":"boolean"}},"required":["acknowledged"]}}}},"404":{"description":"Record Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"response":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]},"isAbort":{"type":"boolean"},"originalError":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"data":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]}},"required":["url","status","data"]},"name":{"type":"string"}},"required":["url","status","response","isAbort","originalError","name"]}}}}},"security":[]}},"/waypoint":{"get":{"summary":"list","deprecated":false,"description":"","tags":[],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"author":{"type":"string"},"collectionId":{"type":"string"},"collectionName":{"type":"string"},"created":{"type":"string"},"description":{"type":"string"},"icon":{"type":"string"},"id":{"type":"string"},"lat":{"type":"number"},"lon":{"type":"number"},"name":{"type":"string"},"photos":{"type":"array","items":{"type":"string"}},"updated":{"type":"string"}},"required":["author","collectionId","collectionName","created","description","icon","id","lat","lon","name","photos","updated"]}}}}}},"security":[]},"put":{"summary":"create","deprecated":false,"description":"","tags":[],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"author":{"type":"string"},"lat":{"type":"integer"},"lon":{"type":"integer"},"icon":{"type":"string"}},"required":["lat","lon","author"]},"example":""}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"author":{"type":"string"},"collectionId":{"type":"string"},"collectionName":{"type":"string"},"created":{"type":"string"},"description":{"type":"string"},"icon":{"type":"string"},"id":{"type":"string"},"lat":{"type":"integer"},"lon":{"type":"integer"},"name":{"type":"string"},"photos":{"type":"array","items":{"type":"string"}},"updated":{"type":"string"}},"required":["author","collectionId","collectionName","created","description","icon","id","lat","lon","name","photos","updated"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"response":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]},"isAbort":{"type":"boolean"},"originalError":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"data":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]}},"required":["url","status","data"]},"name":{"type":"string"}},"required":["url","status","response","isAbort","originalError","name"]}}}},"x-400:Bad Request":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"response":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{"author":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["author"]}},"required":["code","message","data"]},"isAbort":{"type":"boolean"},"originalError":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"data":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{"author":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["author"]}},"required":["code","message","data"]}},"required":["url","status","data"]},"name":{"type":"string"}},"required":["url","status","response","isAbort","originalError","name"]}}}}},"security":[]}},"/summit-log":{"get":{"summary":"list","deprecated":false,"description":"","tags":[],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"collectionId":{"type":"string"},"collectionName":{"type":"string"},"created":{"type":"string"},"date":{"type":"string"},"id":{"type":"string"},"text":{"type":"string"},"updated":{"type":"string"}}}}}}}},"security":[]},"put":{"summary":"create","deprecated":false,"description":"","tags":[],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string"},"text":{"type":"string"}},"required":["date","text"]},"example":""}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"collectionId":{"type":"string"},"collectionName":{"type":"string"},"created":{"type":"string"},"date":{"type":"string"},"id":{"type":"string"},"text":{"type":"string"},"updated":{"type":"string"}},"required":["collectionId","collectionName","created","date","id","text","updated"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"response":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]},"isAbort":{"type":"boolean"},"originalError":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"data":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]}},"required":["url","status","data"]},"name":{"type":"string"}},"required":["url","status","response","isAbort","originalError","name"]}}}},"x-400:Bad Request":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"response":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{"author":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["author"]}},"required":["code","message","data"]},"isAbort":{"type":"boolean"},"originalError":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"data":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{"author":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["author"]}},"required":["code","message","data"]}},"required":["url","status","data"]},"name":{"type":"string"}},"required":["url","status","response","isAbort","originalError","name"]}}}}},"security":[]}},"/trail":{"get":{"summary":"list","deprecated":false,"description":"","tags":[],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"page":{"type":"integer"},"perPage":{"type":"integer"},"totalItems":{"type":"integer"},"totalPages":{"type":"integer"},"items":{"type":"array","items":{"type":"object","properties":{"author":{"type":"string"},"category":{"type":"string"},"collectionId":{"type":"string"},"collectionName":{"type":"string"},"created":{"type":"string"},"description":{"type":"string"},"difficulty":{"type":"string"},"distance":{"type":"integer"},"duration":{"type":"integer"},"elevation_gain":{"type":"integer"},"gpx":{"type":"string"},"id":{"type":"string"},"lat":{"type":"number"},"location":{"type":"string"},"lon":{"type":"number"},"name":{"type":"string"},"photos":{"type":"array","items":{"type":"string"}},"public":{"type":"boolean"},"summit_logs":{"type":"array","items":{"type":"string"}},"thumbnail":{"type":"integer"},"updated":{"type":"string"},"waypoints":{"type":"array","items":{"type":"string"}}},"required":["author","category","collectionId","collectionName","created","description","difficulty","distance","duration","elevation_gain","gpx","id","lat","location","lon","name","photos","public","summit_logs","thumbnail","updated","waypoints"]}}},"required":["page","perPage","totalItems","totalPages","items"]}}}}},"security":[]}},"/list":{"get":{"summary":"list","deprecated":false,"description":"","tags":[],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"author":{"type":"string"},"avatar":{"type":"string"},"collectionId":{"type":"string"},"collectionName":{"type":"string"},"created":{"type":"string"},"description":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"trails":{"type":"array","items":{"type":"string"}},"updated":{"type":"string"},"expand":{"type":"object","properties":{"trails":{"type":"array","items":{"type":"object","properties":{"author":{"type":"string"},"category":{"type":"string"},"collectionId":{"type":"string"},"collectionName":{"type":"string"},"created":{"type":"string"},"description":{"type":"string"},"difficulty":{"type":"string"},"distance":{"type":"integer"},"duration":{"type":"integer"},"elevation_gain":{"type":"integer"},"expand":{"type":"object","properties":{"category":{"type":"object","properties":{"collectionId":{"type":"string"},"collectionName":{"type":"string"},"created":{"type":"string"},"id":{"type":"string"},"img":{"type":"string"},"name":{"type":"string"},"updated":{"type":"string"}},"required":["collectionId","collectionName","created","id","img","name","updated"]},"waypoints":{"type":"array","items":{"type":"object","properties":{"author":{"type":"string"},"collectionId":{"type":"string"},"collectionName":{"type":"string"},"created":{"type":"string"},"description":{"type":"string"},"icon":{"type":"string"},"id":{"type":"string"},"lat":{"type":"number"},"lon":{"type":"number"},"name":{"type":"string"},"photos":{"type":"array","items":{"type":"string"}},"updated":{"type":"string"}},"required":["author","collectionId","collectionName","created","description","icon","id","lat","lon","name","photos","updated"]}}},"required":["category"]},"gpx":{"type":"string"},"id":{"type":"string"},"lat":{"type":"number"},"location":{"type":"string"},"lon":{"type":"number"},"name":{"type":"string"},"photos":{"type":"array","items":{"type":"string"}},"public":{"type":"boolean"},"summit_logs":{"type":"array","items":{"type":"string"}},"thumbnail":{"type":"integer"},"updated":{"type":"string"},"waypoints":{"type":"array","items":{"type":"string"}}},"required":["author","category","collectionId","collectionName","created","description","difficulty","distance","duration","elevation_gain","expand","gpx","id","lat","location","lon","name","photos","public","summit_logs","thumbnail","updated","waypoints"]}}},"required":["trails"]}},"required":["author","avatar","collectionId","collectionName","created","description","id","name","trails","updated"]}}}}}},"security":[]},"put":{"summary":"create","deprecated":false,"description":"","tags":[],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"author":{"type":"string"}},"required":["author","name"]},"example":""}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"author":{"type":"string"},"avatar":{"type":"string"},"collectionId":{"type":"string"},"collectionName":{"type":"string"},"created":{"type":"string"},"description":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"trails":{"type":"array","items":{"type":"string"}},"updated":{"type":"string"}},"required":["author","avatar","collectionId","collectionName","created","description","id","name","trails","updated"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"response":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]},"isAbort":{"type":"boolean"},"originalError":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"data":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{}}},"required":["code","message","data"]}},"required":["url","status","data"]},"name":{"type":"string"}},"required":["url","status","response","isAbort","originalError","name"]}}}}},"security":[]}},"/user":{"put":{"summary":"create","deprecated":false,"description":"","tags":[],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"},"passwordConfirm":{"type":"string"},"email":{"type":"string"}},"required":["username","password","passwordConfirm","email"]},"example":""}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"avatar":{"type":"string"},"collectionId":{"type":"string"},"collectionName":{"type":"string"},"created":{"type":"string"},"emailVisibility":{"type":"boolean"},"id":{"type":"string"},"language":{"type":"string"},"location":{"type":"null"},"token":{"type":"string"},"unit":{"type":"string"},"updated":{"type":"string"},"username":{"type":"string"},"verified":{"type":"boolean"}},"required":["avatar","collectionId","collectionName","created","emailVisibility","id","language","location","token","unit","updated","username","verified"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"response":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{"passwordConfirm":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"username":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["passwordConfirm","username"]}},"required":["code","message","data"]},"isAbort":{"type":"boolean"},"originalError":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"data":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{"passwordConfirm":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"username":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["passwordConfirm","username"]}},"required":["code","message","data"]}},"required":["url","status","data"]},"name":{"type":"string"}},"required":["url","status","response","isAbort","originalError","name"]}}}}},"security":[]}},"/trail/upload":{"put":{"summary":"upload","deprecated":false,"description":"","tags":[],"parameters":[{"name":"Content-Type","in":"header","description":"","required":true,"example":"application/gpx+xml","schema":{"type":"string"}}],"requestBody":{"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"public":{"type":"boolean"},"difficulty":{"type":"string"},"lat":{"type":"number"},"lon":{"type":"number"},"thumbnail":{"type":"integer"},"photos":{"type":"array","items":{"type":"string"}},"waypoints":{"type":"array","items":{"type":"string"}},"summit_logs":{"type":"array","items":{"type":"string"}},"expand":{"type":"object","properties":{"waypoints":{"type":"array","items":{"type":"string"}},"summit_logs":{"type":"array","items":{"type":"string"}}},"required":["waypoints","summit_logs"]},"tags":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"author":{"type":"string"}},"required":["name","public","difficulty","lat","lon","thumbnail","photos","waypoints","summit_logs","expand","tags","description","author"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"integer"},"response":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"isAbort":{"type":"boolean"},"originalError":{"type":"object","properties":{"status":{"type":"integer"},"response":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["status","response"]},"name":{"type":"string"}},"required":["url","status","response","isAbort","originalError","name"]}}}}},"security":[]}}},"components":{"schemas":{},"securitySchemes":{}},"servers":[]} \ No newline at end of file