{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-maps/json-schema/google-maps-snap-to-roads-response-schema.json",
  "title": "SnapToRoadsResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_superseded/google-maps-roads-api-api-openapi.yml#/components/schemas/SnapToRoadsResponse",
  "type": "object",
  "properties": {
    "snappedPoints": {
      "description": "An array of snapped points.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/SnappedPoint"
      }
    },
    "warningMessage": {
      "description": "A string containing a user-visible warning.",
      "type": "string"
    }
  },
  "$defs": {
    "LatitudeLongitudeLiteral": {
      "type": "object",
      "title": "LatitudeLongitudeLiteral",
      "description": "An object describing a specific location with Latitude and Longitude in decimal degrees.",
      "required": [
        "latitude",
        "longitude"
      ],
      "properties": {
        "latitude": {
          "type": "number",
          "description": "Latitude in decimal degrees"
        },
        "longitude": {
          "type": "number",
          "description": "Longitude in decimal degrees"
        }
      }
    },
    "SnappedPoint": {
      "type": "object",
      "title": "SnappedPoint",
      "required": [
        "location",
        "placeId"
      ],
      "properties": {
        "location": {
          "$ref": "#/$defs/LatitudeLongitudeLiteral"
        },
        "originalIndex": {
          "description": "An integer that indicates the corresponding value in the original request. Each value in the request should map to a snapped value in the response. However, if you've set interpolate=true or if you're using nearest roads, then it's possible that the response will contain more coordinates than the request. Interpolated values will not have an `originalIndex`. These values are indexed from `0`, so a point with an originalIndex of `4` will be the snapped value of the 5th latitude/longitude passed to the path parameter. Nearest Roads points may contain several points for single coordinates with differing location or placeId.",
          "type": "number"
        },
        "placeId": {
          "description": "A unique identifier for a place. All place IDs returned by the Roads API correspond to road segments.",
          "type": "string"
        }
      }
    }
  }
}