{"openapi":"3.1.0","info":{"title":"German Railway Station Mock API","description":"Search static station data by name or find the nearest stations. Name and location filters can be combined. No live railway information.","version":"1.0.0"},"paths":{"/api/v1/stations":{"get":{"tags":["Stations"],"summary":"Search Stations","description":"Search stations by name, location, or both.\n\nWithout coordinates results are sorted by name, then ID. With coordinates\nresults are sorted by great-circle distance, then ID. Total counts all\nmatches before the result limit is applied.","operationId":"search_stations_api_v1_stations_get","parameters":[{"name":"name","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Case-insensitive partial name match; surrounding whitespace is ignored.","title":"Name"},"description":"Case-insensitive partial name match; surrounding whitespace is ignored."},{"name":"latitude","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":90,"minimum":-90},{"type":"null"}],"description":"Latitude in degrees; requires longitude.","title":"Latitude"},"description":"Latitude in degrees; requires longitude."},{"name":"longitude","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":180,"minimum":-180},{"type":"null"}],"description":"Longitude in degrees; requires latitude.","title":"Longitude"},"description":"Longitude in degrees; requires latitude."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Maximum number of results, nearest first when coordinates are supplied.","default":20,"title":"Limit"},"description":"Maximum number of results, nearest first when coordinates are supplied."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StationResults"}}}},"400":{"description":"Invalid search parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/stations/{station_id}":{"get":{"tags":["Stations"],"summary":"Get Station","description":"Get a station by its original dataset ID.","operationId":"get_station_api_v1_stations__station_id__get","parameters":[{"name":"station_id","in":"path","required":true,"schema":{"type":"string","title":"Station Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Station"}}}},"404":{"description":"Station not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"ErrorResponse":{"properties":{"detail":{"anyOf":[{"type":"string"},{"items":{"additionalProperties":true,"type":"object"},"type":"array"}],"title":"Detail"}},"type":"object","required":["detail"],"title":"ErrorResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Station":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"services":{"items":{"type":"string"},"type":"array","title":"Services"},"latitude":{"type":"number","maximum":90.0,"minimum":-90.0,"title":"Latitude"},"longitude":{"type":"number","maximum":180.0,"minimum":-180.0,"title":"Longitude"},"distanceMeters":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Distancemeters","description":"Distance from the query location in meters; null without a location."}},"type":"object","required":["id","name","services","latitude","longitude"],"title":"Station"},"StationResults":{"properties":{"items":{"items":{"$ref":"#/components/schemas/Station"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total","description":"Number of matching stations before applying limit."},"limit":{"type":"integer","title":"Limit"}},"type":"object","required":["items","total","limit"],"title":"StationResults"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}