{
  "openapi": "3.0.3",
  "info": {
    "title": "Aliağa Taksi Durakları GeoJSON API",
    "description": "Aliağa ve Yeni Şakran ilçelerindeki tüm taksi duraklarının anlık konumları, adresleri, telefon numaraları ve coğrafi koordinatlarını sağlayan RESTful GeoJSON API servisi.\n\n### Özellikler\n- **RFC 7946 GeoJSON Standardı:** Tam uyumlu `FeatureCollection` yapısı.\n- **Coğrafi Mesafe Hesaplama:** Kullanıcı koordinatları (`lat`, `lon`) ile en yakından uzağa sıralama ve mesafe bilgisi.\n- **Akıllı Filtreleme:** Durak adı, mahalle, cadde veya telefonla arama desteği (`q`, `mahalle`).\n- **Edge CDN Cache:** Yüksek hızlı CDN önbellekleme.\n\n**Hizmet Sağlayıcı:** [Fatih Acar Bilişim](https://www.fatihacar.com.tr) & [Aliağam.NET](https://taksi.aliagam.net)",
    "version": "1.0.0",
    "contact": {
      "name": "Fatih Acar Bilişim Hizmetleri",
      "url": "https://www.fatihacar.com.tr",
      "email": "info@fatihacar.com.tr"
    }
  },
  "servers": [
    {
      "url": "https://taksi.aliagam.net",
      "description": "Aliagam.NET"
    },
  ],
  "paths": {
    "/api": {
      "get": {
        "summary": "Taksi Duraklarını Listele (GeoJSON)",
        "description": "Aliağa ilçesindeki taksi duraklarını GeoJSON FeatureCollection formatında döndürür. İsteğe bağlı olarak arama, mahalle filtresi veya kullanıcı koordinatlarına göre mesafe hesaplaması destekler.",
        "operationId": "getTaksiDuraklari",
        "tags": [
          "Taksi Durakları"
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Durak adı, cadde, mahalle veya telefon arama kelimesi.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "Merkez"
          },
          {
            "name": "mahalle",
            "in": "query",
            "description": "Belirli bir mahalleye göre filtreleme (örn: SİTELER, KÜLTÜR, ATATÜRK).",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "SİTELER"
          },
          {
            "name": "lat",
            "in": "query",
            "description": "Kullanıcı enlem (latitude) koordinatı. Verilirse durakların mesafesi hesaplanır ve en yakından uzağa sıralanır.",
            "required": false,
            "schema": {
              "type": "number",
              "format": "float"
            },
            "example": 38.7993
          },
          {
            "name": "lon",
            "in": "query",
            "description": "Kullanıcı boylam (longitude) koordinatı. 'lat' parametresi ile birlikte kullanılmalıdır.",
            "required": false,
            "schema": {
              "type": "number",
              "format": "float"
            },
            "example": 26.9705
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı GeoJSON FeatureCollection yanıtı",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeatureCollection"
                },
                "example": {
                  "type": "FeatureCollection",
                  "metadata": {
                    "ilce": "ALİAĞA",
                    "guncelleme_tarihi": "2026-10-14",
                    "toplam_durak": 12
                  },
                  "features": [
                    {
                      "type": "Feature",
                      "geometry": {
                        "type": "Point",
                        "coordinates": [
                          26.970537456918,
                          38.7989985567
                        ]
                      },
                      "properties": {
                        "adi": "Merkez Taksi Durağı",
                        "mahalle": "KAZIM DİRİK",
                        "yol": "CUMHURİYET",
                        "kapi_no": null,
                        "aciklama": null,
                        "ilce": "ALİAĞA",
                        "telefon": "02326161903",
                        "telefon_formatli": "0 (232) 616 19 03",
                        "harita_yonlendirme_url": "https://www.google.com/maps/dir/?api=1&destination=38.7989985567,26.970537456918",
                        "mesafe_km": 0.03,
                        "mesafe_metre": 30
                      }
                    }
                  ]
                }
              }
            }
          },
          "502": {
            "description": "Kaynak veriye erişilemedi",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "detail": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/.netlify/functions/taksiduraklari": {
      "get": {
        "summary": "Doğrudan Netlify Functions Uç Noktası",
        "description": "Mevcut geriye dönük uyumluluk uç noktası. '/api' ile birebir aynı işlevi görür.",
        "tags": [
          "Taksi Durakları"
        ],
        "responses": {
          "200": {
            "description": "Başarılı GeoJSON FeatureCollection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeatureCollection"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "FeatureCollection": {
        "type": "object",
        "required": [
          "type",
          "metadata",
          "features"
        ],
        "properties": {
          "type": {
            "type": "string",
            "example": "FeatureCollection"
          },
          "metadata": {
            "type": "object",
            "properties": {
              "ilce": {
                "type": "string",
                "example": "ALİAĞA"
              },
              "guncelleme_tarihi": {
                "type": "string",
                "format": "date",
                "example": "2026-10-14"
              },
              "toplam_durak": {
                "type": "integer",
                "example": 12
              }
            }
          },
          "features": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Feature"
            }
          }
        }
      },
      "Feature": {
        "type": "object",
        "required": [
          "type",
          "geometry",
          "properties"
        ],
        "properties": {
          "type": {
            "type": "string",
            "example": "Feature"
          },
          "geometry": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "example": "Point"
              },
              "coordinates": {
                "type": "array",
                "items": {
                  "type": "number"
                },
                "example": [
                  26.970537,
                  38.798998
                ]
              }
            }
          },
          "properties": {
            "$ref": "#/components/schemas/Properties"
          }
        }
      },
      "Properties": {
        "type": "object",
        "properties": {
          "adi": {
            "type": "string",
            "example": "Merkez Taksi Durağı"
          },
          "mahalle": {
            "type": "string",
            "example": "KAZIM DİRİK"
          },
          "yol": {
            "type": "string",
            "example": "CUMHURİYET"
          },
          "kapi_no": {
            "type": "string",
            "nullable": true
          },
          "aciklama": {
            "type": "string",
            "nullable": true
          },
          "ilce": {
            "type": "string",
            "example": "ALİAĞA"
          },
          "telefon": {
            "type": "string",
            "example": "02326161903",
            "nullable": true
          },
          "telefon_formatli": {
            "type": "string",
            "example": "0 (232) 616 19 03",
            "nullable": true
          },
          "harita_yonlendirme_url": {
            "type": "string",
            "example": "https://www.google.com/maps/dir/?api=1&destination=38.798998,26.970537",
            "nullable": true
          },
          "mesafe_km": {
            "type": "number",
            "format": "float",
            "nullable": true,
            "example": 0.45
          },
          "mesafe_metre": {
            "type": "integer",
            "nullable": true,
            "example": 450
          }
        }
      }
    }
  }
}