{
    "openapi": "3.1.0",
    "info": {
        "title": "San Antonio Trail and Sidewalk Access API",
        "version": "1.0.0",
        "summary": "Trail surface accessibility and sidewalk network coverage for San Antonio, Texas.",
        "description": "Read-only, CORS-enabled, cached JSON over the City of San Antonio's own open GIS layers.\n\nNothing in this API is an ADA compliance determination. The City trail layer contains no width, grade or cross slope, so compliance cannot be established from it. Sidewalk width is a nominal inventory width, not ADA clear width. Every response carries a `caveats` object stating these conditions.",
        "contact": {
            "name": "BrandShyp",
            "url": "https://brandshyp.org/contact-us/"
        },
        "license": {
            "name": "City of San Antonio open data",
            "url": "https://data.sanantonio.gov/"
        }
    },
    "externalDocs": {
        "description": "Human documentation, with the maps and the caveats in context",
        "url": "https://brandshyp.org/san-antonio-trail-access/"
    },
    "servers": [
        {
            "url": "https://brandshyp.org/api/v1/trail-access"
        }
    ],
    "security": [],
    "tags": [
        {
            "name": "trails",
            "description": "Trail surface accessibility"
        },
        {
            "name": "sidewalks",
            "description": "Sidewalk network coverage by council district"
        },
        {
            "name": "meta",
            "description": "Discovery, data quality and geometry"
        }
    ],
    "paths": {
        "/": {
            "get": {
                "summary": "Discovery document",
                "operationId": "getRoot",
                "tags": [
                    "meta"
                ],
                "responses": {
                    "200": {
                        "description": "Service description, coverage and integrity, derived live from the dataset.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "caveats"
                                    ],
                                    "properties": {
                                        "caveats": {
                                            "$ref": "#/components/schemas/Caveats"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "405": {
                        "description": "Method not allowed. This API is read-only (GET).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Dataset temporarily unavailable. It is rebuilt monthly.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/trails": {
            "get": {
                "summary": "All named trails",
                "operationId": "getTrails",
                "tags": [
                    "trails"
                ],
                "responses": {
                    "200": {
                        "description": "Every named trail with its surface mix.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "caveats"
                                    ],
                                    "properties": {
                                        "caveats": {
                                            "$ref": "#/components/schemas/Caveats"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "405": {
                        "description": "Method not allowed. This API is read-only (GET).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Dataset temporarily unavailable. It is rebuilt monthly.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/trails.csv": {
            "get": {
                "summary": "All named trails as CSV",
                "operationId": "getTrailsCsv",
                "tags": [
                    "trails"
                ],
                "responses": {
                    "200": {
                        "description": "Tidy CSV, one row per named trail.",
                        "content": {
                            "text/csv": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "405": {
                        "description": "Method not allowed. This API is read-only (GET).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Dataset temporarily unavailable. It is rebuilt monthly.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/trail/{slug}": {
            "get": {
                "summary": "One named trail",
                "operationId": "getTrail",
                "tags": [
                    "trails"
                ],
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "description": "Trail id as published in /trails.",
                        "schema": {
                            "type": "string",
                            "pattern": "^[a-z0-9-]{1,120}$"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The named trail.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "caveats"
                                    ],
                                    "properties": {
                                        "caveats": {
                                            "$ref": "#/components/schemas/Caveats"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "405": {
                        "description": "Method not allowed. This API is read-only (GET).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Dataset temporarily unavailable. It is rebuilt monthly.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Malformed id."
                    },
                    "404": {
                        "description": "This dataset does not name a trail with that id. Not a statement that no trail exists there."
                    }
                }
            }
        },
        "/surfaces": {
            "get": {
                "summary": "Surface rollup",
                "operationId": "getSurfaces",
                "tags": [
                    "trails"
                ],
                "responses": {
                    "200": {
                        "description": "Surface material totals and the firmness classification applied.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "caveats"
                                    ],
                                    "properties": {
                                        "caveats": {
                                            "$ref": "#/components/schemas/Caveats"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "405": {
                        "description": "Method not allowed. This API is read-only (GET).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Dataset temporarily unavailable. It is rebuilt monthly.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/districts": {
            "get": {
                "summary": "Sidewalk network by council district",
                "operationId": "getDistricts",
                "tags": [
                    "sidewalks"
                ],
                "responses": {
                    "200": {
                        "description": "Per-district sidewalk mileage with the coverage rates needed to interpret it.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "caveats"
                                    ],
                                    "properties": {
                                        "caveats": {
                                            "$ref": "#/components/schemas/Caveats"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "405": {
                        "description": "Method not allowed. This API is read-only (GET).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Dataset temporarily unavailable. It is rebuilt monthly.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/quality": {
            "get": {
                "summary": "Inventory audit",
                "operationId": "getQuality",
                "tags": [
                    "meta"
                ],
                "responses": {
                    "200": {
                        "description": "Missing-data sentinels and implausible values in the published record.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "caveats"
                                    ],
                                    "properties": {
                                        "caveats": {
                                            "$ref": "#/components/schemas/Caveats"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "405": {
                        "description": "Method not allowed. This API is read-only (GET).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Dataset temporarily unavailable. It is rebuilt monthly.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/geo": {
            "get": {
                "summary": "Pre-projected map geometry",
                "operationId": "getGeo",
                "tags": [
                    "meta"
                ],
                "responses": {
                    "200": {
                        "description": "SVG path data for the trail network and the council districts.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "caveats"
                                    ],
                                    "properties": {
                                        "caveats": {
                                            "$ref": "#/components/schemas/Caveats"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "405": {
                        "description": "Method not allowed. This API is read-only (GET).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Dataset temporarily unavailable. It is rebuilt monthly.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/lines": {
            "get": {
                "summary": "Trail centrelines in WGS84",
                "operationId": "getLines",
                "tags": [
                    "trails"
                ],
                "responses": {
                    "200": {
                        "description": "Trail centrelines as [lat,lng] polylines. Trail names and surface classes are interned: each line carries n and c as indexes into the names and classes arrays. Simplified to roughly 100 m; these are centrelines, not surveyed alignments.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "caveats"
                                    ],
                                    "properties": {
                                        "caveats": {
                                            "$ref": "#/components/schemas/Caveats"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "405": {
                        "description": "Method not allowed. This API is read-only (GET).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Dataset temporarily unavailable. It is rebuilt monthly.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/openapi.json": {
            "get": {
                "summary": "This document",
                "operationId": "getOpenapi",
                "tags": [
                    "meta"
                ],
                "responses": {
                    "200": {
                        "description": "OpenAPI 3.1 description.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "caveats"
                                    ],
                                    "properties": {
                                        "caveats": {
                                            "$ref": "#/components/schemas/Caveats"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "405": {
                        "description": "Method not allowed. This API is read-only (GET).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Dataset temporarily unavailable. It is rebuilt monthly.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "Error": {
                "type": "object",
                "required": [
                    "error",
                    "status"
                ],
                "properties": {
                    "error": {
                        "type": "string",
                        "description": "Human-readable explanation."
                    },
                    "status": {
                        "type": "integer",
                        "description": "HTTP status code, repeated in the body."
                    }
                }
            },
            "Caveats": {
                "type": "object",
                "description": "Merged into every successful response. These are the conditions under which the figures mean anything; it is deliberately not possible to consume this API without them.",
                "properties": {
                    "not_a_compliance_determination": {
                        "type": "string",
                        "description": "Nothing in this dataset establishes ADA compliance. The City trail layer records a surface material and a length; it contains no tread width, no running grade, no cross slope and no obstruction survey. No trail here is certified, and none can be from this record."
                    },
                    "width_is_recorded_width": {
                        "type": "string",
                        "description": "Sidewalk Width is a nominal inventory width. ADA governs CLEAR width, which is what remains after poles, hydrants, signs and overgrowth, and this inventory does not contain it. A segment \"carries a recorded width below 36 inches\"; it is not asserted to fail the ADA minimum."
                    },
                    "missing_data_sentinels": {
                        "type": "string",
                        "description": "The source uses sentinel values: SidewalkScore = -999 and Width = 0 both mean NOT RECORDED. They are excluded from every statistic here and are reported separately under /quality."
                    },
                    "coverage_varies": {
                        "type": "string",
                        "description": "Inventory coverage is uneven between council districts. A district can show almost no sub-36-inch sidewalk because its sidewalks are wide, or because its widths were never measured. Always read a width figure beside width_blank_pct."
                    },
                    "surface_undecidable": {
                        "type": "string",
                        "description": "Aggregate and wood surfaces are classified \"undecidable\", not compliant or non-compliant: firmness depends on binder, compaction, joint gaps and maintenance, none of which the City publishes."
                    }
                }
            }
        }
    }
}