-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.json
More file actions
1 lines (1 loc) · 13.7 KB
/
openapi.json
File metadata and controls
1 lines (1 loc) · 13.7 KB
1
{"openapi":"3.0.3","info":{"title":"rustmicro","description":"","license":{"name":""},"version":"0.1.0"},"paths":{"/":{"get":{"tags":["handlers"],"summary":"API ana sayfası","description":"Bu endpoint, API'nin çalıştığını ve temel bilgileri döndürür.\n\n# Returns\n\n* `HttpResponse` - JSON formatında API bilgisi","operationId":"index","responses":{"200":{"description":"API çalışıyor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}}},"/api/v1/ports":{"get":{"tags":["ports"],"operationId":"get_all_ports","responses":{"200":{"description":"Liman listesi","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PortResponse"}}}}},"500":{"description":"Sunucu hatası","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}},"post":{"tags":["ports"],"operationId":"create_port","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePort"}}},"required":true},"responses":{"201":{"description":"Liman oluşturuldu","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortResponse"}}}},"400":{"description":"Geçersiz istek","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"500":{"description":"Sunucu hatası","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}}},"/api/v1/ports/country/{country}":{"get":{"tags":["ports"],"operationId":"get_ports_by_country","parameters":[{"name":"country","in":"path","description":"Ülke adı","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Liman listesi","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PortResponse"}}}}},"500":{"description":"Sunucu hatası","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}}},"/api/v1/ports/nearest":{"post":{"tags":["ports"],"operationId":"find_nearest_port","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FindNearestPortRequest"}}},"required":true},"responses":{"200":{"description":"Yakındaki limanlar","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PortResponse"}}}}},"500":{"description":"Sunucu hatası","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}}},"/api/v1/ports/type/{port_type}":{"get":{"tags":["ports"],"operationId":"get_ports_by_type","parameters":[{"name":"port_type","in":"path","description":"Liman tipi (container, cruise, cargo, fishing)","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Liman listesi","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PortResponse"}}}}},"500":{"description":"Sunucu hatası","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}}},"/api/v1/stats":{"get":{"tags":["stats"],"operationId":"get_stats","responses":{"200":{"description":"İstatistikler","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatsResponse"}}}},"500":{"description":"Sunucu hatası","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}}},"/api/v1/users":{"get":{"tags":["users"],"operationId":"get_all_users","responses":{"200":{"description":"Kullanıcı listesi","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserResponse"}}}}},"500":{"description":"Sunucu hatası","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}},"post":{"tags":["users"],"operationId":"create_user","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUser"}}},"required":true},"responses":{"201":{"description":"Kullanıcı oluşturuldu","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"400":{"description":"Geçersiz istek","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"500":{"description":"Sunucu hatası","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}}},"/api/v1/users/{id}":{"get":{"tags":["users"],"operationId":"get_user","parameters":[{"name":"id","in":"path","description":"Kullanıcı ID'si (UUID)","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Kullanıcı bulundu","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"400":{"description":"Geçersiz ID formatı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"404":{"description":"Kullanıcı bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"500":{"description":"Sunucu hatası","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}},"put":{"tags":["users"],"operationId":"update_user","parameters":[{"name":"id","in":"path","description":"Kullanıcı ID'si (UUID)","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUser"}}},"required":true},"responses":{"200":{"description":"Kullanıcı güncellendi","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"400":{"description":"Geçersiz ID formatı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"404":{"description":"Kullanıcı bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"500":{"description":"Sunucu hatası","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}},"delete":{"tags":["users"],"operationId":"delete_user","parameters":[{"name":"id","in":"path","description":"Kullanıcı ID'si (UUID)","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Kullanıcı silindi","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"400":{"description":"Geçersiz ID formatı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"404":{"description":"Kullanıcı bulunamadı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"500":{"description":"Sunucu hatası","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}}},"/health":{"get":{"tags":["health"],"summary":"Sağlık kontrolü","description":"Bu endpoint, API'nin sağlık durumunu kontrol eder.\n\n# Returns\n\n* `HttpResponse` - JSON formatında sağlık durumu","operationId":"health_check","responses":{"200":{"description":"API çalışıyor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}}}},"components":{"schemas":{"ApiResponse":{"type":"object","required":["message","status"],"properties":{"message":{"type":"string"},"status":{"type":"string"}}},"CreatePort":{"type":"object","required":["name","code","country","city","latitude","longitude","port_type"],"properties":{"capacity":{"type":"integer","format":"int32","description":"TEU kapasitesi (isteğe bağlı)","nullable":true},"city":{"type":"string","description":"Limanın bulunduğu şehir"},"code":{"type":"string","description":"Limanın IATA/ICAO kodu (örn: TRIST, TRMER)"},"country":{"type":"string","description":"Limanın bulunduğu ülke"},"latitude":{"type":"number","format":"double","description":"Limanın enlemi"},"longitude":{"type":"number","format":"double","description":"Limanın boylamı"},"name":{"type":"string","description":"Limanın adı"},"port_type":{"type":"string","description":"Limanın tipi (\"container\", \"cruise\", \"cargo\", \"fishing\")"}}},"CreateUser":{"type":"object","required":["name","email"],"properties":{"email":{"type":"string","description":"Kullanıcının e-posta adresi"},"latitude":{"type":"number","format":"double","description":"Kullanıcının enlemi (isteğe bağlı)","nullable":true},"longitude":{"type":"number","format":"double","description":"Kullanıcının boylamı (isteğe bağlı)","nullable":true},"name":{"type":"string","description":"Kullanıcının adı"}}},"FindNearestPortRequest":{"type":"object","required":["latitude","longitude"],"properties":{"latitude":{"type":"number","format":"double","description":"Arama yapılacak konumun enlemi"},"longitude":{"type":"number","format":"double","description":"Arama yapılacak konumun boylamı"}}},"Port":{"type":"object","required":["id","name","code","country","city","latitude","longitude","h3_index","port_type","created_at","updated_at"],"properties":{"capacity":{"type":"integer","format":"int32","description":"TEU kapasitesi (isteğe bağlı)","nullable":true},"city":{"type":"string","description":"Limanın bulunduğu şehir"},"code":{"type":"string","description":"Limanın IATA/ICAO kodu (örn: TRIST, TRMER)"},"country":{"type":"string","description":"Limanın bulunduğu ülke"},"created_at":{"$ref":"#/components/schemas/DateTime"},"h3_index":{"type":"string","description":"Limanın H3 indeksi"},"id":{"$ref":"#/components/schemas/Uuid"},"latitude":{"type":"number","format":"double","description":"Limanın enlemi"},"longitude":{"type":"number","format":"double","description":"Limanın boylamı"},"name":{"type":"string","description":"Limanın adı"},"port_type":{"type":"string","description":"Limanın tipi (\"container\", \"cruise\", \"cargo\", \"fishing\")"},"updated_at":{"$ref":"#/components/schemas/DateTime"}}},"PortResponse":{"type":"object","required":["id","name","code","country","city","latitude","longitude","h3_index","port_type","created_at","updated_at"],"properties":{"capacity":{"type":"integer","format":"int32","description":"TEU kapasitesi (isteğe bağlı)","nullable":true},"city":{"type":"string","description":"Limanın bulunduğu şehir"},"code":{"type":"string","description":"Limanın IATA/ICAO kodu (örn: TRIST, TRMER)"},"country":{"type":"string","description":"Limanın bulunduğu ülke"},"created_at":{"$ref":"#/components/schemas/DateTime"},"h3_index":{"type":"string","description":"Limanın H3 indeksi"},"id":{"type":"string","description":"Limanın string formatında kimliği"},"latitude":{"type":"number","format":"double","description":"Limanın enlemi"},"longitude":{"type":"number","format":"double","description":"Limanın boylamı"},"name":{"type":"string","description":"Limanın adı"},"port_type":{"type":"string","description":"Limanın tipi (\"container\", \"cruise\", \"cargo\", \"fishing\")"},"updated_at":{"$ref":"#/components/schemas/DateTime"}}},"StatsResponse":{"type":"object","required":["total_users","status"],"properties":{"status":{"type":"string"},"total_users":{"type":"integer","format":"int64"}}},"UpdatePort":{"type":"object","properties":{"capacity":{"type":"integer","format":"int32","description":"TEU kapasitesi (isteğe bağlı)","nullable":true},"city":{"type":"string","description":"Limanın bulunduğu şehir (isteğe bağlı)","nullable":true},"code":{"type":"string","description":"Limanın IATA/ICAO kodu (örn: TRIST, TRMER) (isteğe bağlı)","nullable":true},"country":{"type":"string","description":"Limanın bulunduğu ülke (isteğe bağlı)","nullable":true},"latitude":{"type":"number","format":"double","description":"Limanın enlemi (isteğe bağlı)","nullable":true},"longitude":{"type":"number","format":"double","description":"Limanın boylamı (isteğe bağlı)","nullable":true},"name":{"type":"string","description":"Limanın adı (isteğe bağlı)","nullable":true},"port_type":{"type":"string","description":"Limanın tipi (\"container\", \"cruise\", \"cargo\", \"fishing\") (isteğe bağlı)","nullable":true}}},"UpdateUser":{"type":"object","properties":{"email":{"type":"string","description":"Kullanıcının e-posta adresi (isteğe bağlı)","nullable":true},"latitude":{"type":"number","format":"double","description":"Kullanıcının enlemi (isteğe bağlı)","nullable":true},"longitude":{"type":"number","format":"double","description":"Kullanıcının boylamı (isteğe bağlı)","nullable":true},"name":{"type":"string","description":"Kullanıcının adı (isteğe bağlı)","nullable":true}}},"User":{"type":"object","required":["id","name","email","created_at","updated_at"],"properties":{"created_at":{"$ref":"#/components/schemas/DateTime"},"email":{"type":"string","description":"Kullanıcının e-posta adresi"},"h3_index":{"type":"string","description":"Kullanıcının H3 indeksi (isteğe bağlı)","nullable":true},"id":{"$ref":"#/components/schemas/Uuid"},"latitude":{"type":"number","format":"double","description":"Kullanıcının enlemi (isteğe bağlı)","nullable":true},"longitude":{"type":"number","format":"double","description":"Kullanıcının boylamı (isteğe bağlı)","nullable":true},"name":{"type":"string","description":"Kullanıcının adı"},"updated_at":{"$ref":"#/components/schemas/DateTime"}}},"UserResponse":{"type":"object","required":["id","name","email","created_at","updated_at"],"properties":{"created_at":{"$ref":"#/components/schemas/DateTime"},"email":{"type":"string","description":"Kullanıcının e-posta adresi"},"h3_index":{"type":"string","description":"Kullanıcının H3 indeksi (isteğe bağlı)","nullable":true},"id":{"type":"string","description":"Kullanıcının string formatında kimliği"},"latitude":{"type":"number","format":"double","description":"Kullanıcının enlemi (isteğe bağlı)","nullable":true},"longitude":{"type":"number","format":"double","description":"Kullanıcının boylamı (isteğe bağlı)","nullable":true},"name":{"type":"string","description":"Kullanıcının adı"},"updated_at":{"$ref":"#/components/schemas/DateTime"}}}}},"tags":[{"name":"health","description":"Health check endpoints"},{"name":"users","description":"User management endpoints"},{"name":"ports","description":"Port management endpoints"},{"name":"stats","description":"Statistics endpoints"}]}