{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/obraaberta-com-br/json-schema/obraaberta-com-br-servicos-proximos-schema.json",
  "title": "ServicosProximos",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/obraaberta-com-br-openapi.yml#/components/schemas/ServicosProximos",
  "type": "object",
  "properties": {
    "schools": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PontoInteresse"
      }
    },
    "hospitals": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PontoInteresse"
      }
    },
    "transport": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PontoInteresse"
      }
    },
    "commerce": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PontoInteresse"
      }
    },
    "cached": {
      "type": "boolean"
    },
    "degraded": {
      "type": "boolean",
      "description": "true quando a resposta usa cache antigo, a fonte está indisponível ou só parte das consultas respondeu"
    },
    "source_status": {
      "type": "string",
      "enum": [
        "fresh",
        "partial",
        "cache",
        "stale_cache",
        "unavailable"
      ]
    },
    "attribution": {
      "type": "string"
    }
  },
  "$defs": {
    "PontoInteresse": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "distance_km": {
          "type": "number"
        },
        "type": {
          "type": [
            "string",
            "null"
          ]
        },
        "operator": {
          "type": [
            "string",
            "null"
          ]
        },
        "address": {
          "type": [
            "string",
            "null"
          ]
        },
        "phone": {
          "type": [
            "string",
            "null"
          ]
        },
        "source": {
          "type": "string"
        }
      }
    }
  }
}