{
  "$ref": "#/definitions/ocpi.2_2_1.locations",
  "definitions": {
    "ocpi.2_2_1.locations": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "country_code": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2
          },
          "party_id": {
            "type": "string",
            "maxLength": 3
          },
          "id": {
            "type": "string",
            "maxLength": 36
          },
          "publish": {
            "type": "boolean"
          },
          "publish_allowed_to": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "uid": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "type": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "AD_HOC_USER",
                            "APP_USER",
                            "OTHER",
                            "RFID"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "visual_number": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 64
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "issuer": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 64
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "group_id": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 36
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "address": {
            "type": "string",
            "maxLength": 45
          },
          "city": {
            "type": "string",
            "maxLength": 45
          },
          "postal_code": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10
              },
              {
                "type": "null"
              }
            ]
          },
          "state": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "country": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3
          },
          "coordinates": {
            "type": "object",
            "properties": {
              "latitude": {
                "type": "string",
                "maxLength": 10,
                "pattern": "-?[0-9]{1,2}\\.[0-9]{5,7}"
              },
              "longitude": {
                "type": "string",
                "maxLength": 11,
                "pattern": "-?[0-9]{1,3}\\.[0-9]{5,7}"
              }
            },
            "required": [
              "latitude",
              "longitude"
            ],
            "additionalProperties": false
          },
          "related_locations": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "latitude": {
                      "type": "string",
                      "maxLength": 10,
                      "pattern": "-?[0-9]{1,2}\\.[0-9]{5,7}"
                    },
                    "longitude": {
                      "type": "string",
                      "maxLength": 11,
                      "pattern": "-?[0-9]{1,3}\\.[0-9]{5,7}"
                    },
                    "name": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "language": {
                              "type": "string",
                              "minLength": 2,
                              "maxLength": 2
                            },
                            "text": {
                              "type": "string",
                              "maxLength": 512
                            }
                          },
                          "required": [
                            "language",
                            "text"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "latitude",
                    "longitude"
                  ],
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "parking_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "ALONG_MOTORWAY",
                  "ON_STREET",
                  "ON_DRIVEWAY",
                  "PARKING_GARAGE",
                  "UNDERGROUND_GARAGE",
                  "PARKING_LOT"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "evses": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "uid": {
                      "type": "string",
                      "maxLength": 39
                    },
                    "evse_id": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 48
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "AVAILABLE",
                        "BLOCKED",
                        "CHARGING",
                        "INOPERATIVE",
                        "OUTOFORDER",
                        "PLANNED",
                        "REMOVED",
                        "RESERVED",
                        "UNKNOWN"
                      ]
                    },
                    "status_schedule": {
                      "anyOf": [
                        {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "period_begin": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "period_end": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "status": {
                                "$ref": "#/definitions/ocpi.2_2_1.locations/items/properties/evses/anyOf/0/items/properties/status"
                              }
                            },
                            "required": [
                              "period_begin",
                              "period_end",
                              "status"
                            ],
                            "additionalProperties": false
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "capabilities": {
                      "anyOf": [
                        {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "CHARGING_PROFILE_CAPABLE",
                              "CHARGING_PREFERENCES_CAPABLE",
                              "CHIP_CARD_SUPPORT",
                              "CONTACTLESS_CARD_SUPPORT",
                              "CREDIT_CARD_PAYABLE",
                              "DEBIT_CARD_PAYABLE",
                              "PED_TERMINAL",
                              "REMOTE_START_STOP_CAPABLE",
                              "RESERVABLE",
                              "RFID_READER",
                              "START_SESSION_CONNECTOR_REQUIRED",
                              "TOKEN_GROUP_CAPABLE",
                              "UNLOCK_CAPABLE"
                            ]
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "connectors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "maxLength": 36
                          },
                          "standard": {
                            "type": "string",
                            "enum": [
                              "CHADEMO",
                              "CHAOJI",
                              "DOMESTIC_A",
                              "DOMESTIC_B",
                              "DOMESTIC_C",
                              "DOMESTIC_D",
                              "DOMESTIC_E",
                              "DOMESTIC_F",
                              "DOMESTIC_G",
                              "DOMESTIC_H",
                              "DOMESTIC_I",
                              "DOMESTIC_J",
                              "DOMESTIC_K",
                              "DOMESTIC_L",
                              "DOMESTIC_M",
                              "DOMESTIC_N",
                              "DOMESTIC_O",
                              "GBT_AC",
                              "GBT_DC",
                              "IEC_60309_2_SINGLE_16",
                              "IEC_60309_2_THREE_16",
                              "IEC_60309_2_THREE_32",
                              "IEC_60309_2_THREE_64",
                              "IEC_62196_T1",
                              "IEC_62196_T1_COMBO",
                              "IEC_62196_T2",
                              "IEC_62196_T2_COMBO",
                              "IEC_62196_T3A",
                              "IEC_62196_T3C",
                              "NEMA_5_20",
                              "NEMA_6_30",
                              "NEMA_6_50",
                              "NEMA_10_30",
                              "NEMA_10_50",
                              "NEMA_14_30",
                              "NEMA_14_50",
                              "PANTOGRAPH_BOTTOM_UP",
                              "PANTOGRAPH_TOP_DOWN",
                              "TESLA_R",
                              "TESLA_S"
                            ]
                          },
                          "format": {
                            "type": "string",
                            "enum": [
                              "SOCKET",
                              "CABLE"
                            ]
                          },
                          "power_type": {
                            "type": "string",
                            "enum": [
                              "AC_1_PHASE",
                              "AC_2_PHASE",
                              "AC_2_PHASE_SPLIT",
                              "AC_3_PHASE",
                              "DC"
                            ]
                          },
                          "max_voltage": {
                            "type": "integer"
                          },
                          "max_amperage": {
                            "type": "integer"
                          },
                          "max_electric_power": {
                            "anyOf": [
                              {
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "tariff_ids": {
                            "anyOf": [
                              {
                                "type": "array",
                                "items":  {
                                  "type": "string",
                                  "maxLength": 36
                                }
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "terms_and_conditions": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uri"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "last_updated": {
                            "type": "string",
                            "format": "date-time"
                          }
                        },
                        "required": [
                          "id",
                          "standard",
                          "format",
                          "power_type",
                          "max_voltage",
                          "max_amperage",
                          "last_updated"
                        ],
                        "additionalProperties": false
                      },
                      "minItems": 1
                    },
                    "floor_level": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 4
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "coordinates": {
                      "anyOf": [
                        {
                          "$ref": "#/definitions/ocpi.2_2_1.locations/items/properties/coordinates"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "physical_reference": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 16
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "directions": {
                      "anyOf": [
                        {
                          "type": "array",
                          "items": {
                            "$ref": "#/definitions/ocpi.2_2_1.locations/items/properties/related_locations/anyOf/0/items/properties/name/anyOf/0"
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "parking_restrictions": {
                      "anyOf": [
                        {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "EV_ONLY",
                              "PLUGGED",
                              "DISABLED",
                              "CUSTOMERS",
                              "MOTORCYCLES"
                            ]
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "images": {
                      "anyOf": [
                        {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "url": {
                                "type": "string",
                                "format": "uri"
                              },
                              "thumbnail": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "uri"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "category": {
                                "type": "string",
                                "enum": [
                                  "CHARGER",
                                  "ENTRANCE",
                                  "LOCATION",
                                  "NETWORK",
                                  "OPERATOR",
                                  "OTHER",
                                  "OWNER"
                                ]
                              },
                              "type": {
                                "type": "string",
                                "maxLength": 4
                              },
                              "width": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "maximum": 99999
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "height": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "maximum": 99999
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "url",
                              "category",
                              "type"
                            ],
                            "additionalProperties": false
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "last_updated": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "uid",
                    "status",
                    "connectors",
                    "last_updated"
                  ],
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "directions": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/definitions/ocpi.2_2_1.locations/items/properties/related_locations/anyOf/0/items/properties/name/anyOf/0"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "operator": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "website": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uri"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "logo": {
                    "anyOf": [
                      {
                        "$ref": "#/definitions/ocpi.2_2_1.locations/items/properties/evses/anyOf/0/items/properties/images/anyOf/0/items"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "suboperator": {
            "anyOf": [
              {
                "$ref": "#/definitions/ocpi.2_2_1.locations/items/properties/operator/anyOf/0"
              },
              {
                "type": "null"
              }
            ]
          },
          "owner": {
            "anyOf": [
              {
                "$ref": "#/definitions/ocpi.2_2_1.locations/items/properties/operator/anyOf/0"
              },
              {
                "type": "null"
              }
            ]
          },
          "facilities": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "HOTEL",
                    "RESTAURANT",
                    "CAFE",
                    "MALL",
                    "SUPERMARKET",
                    "SPORT",
                    "RECREATION_AREA",
                    "NATURE",
                    "MUSEUM",
                    "BIKE_SHARING",
                    "BUS_STOP",
                    "TAXI_STAND",
                    "TRAM_STOP",
                    "METRO_STATION",
                    "TRAIN_STATION",
                    "AIRPORT",
                    "PARKING_LOT",
                    "CARPOOL_PARKING",
                    "FUEL_STATION",
                    "WIFI"
                  ]
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "time_zone": {
            "type": "string",
            "maxLength": 255
          },
          "opening_times": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "regular_hours": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "weekday": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 7
                            },
                            "period_begin": {
                              "type": "string",
                              "minLength": 5,
                              "maxLength": 5,
                              "pattern": "([0-1][0-9]|2[0-3]):[0-5][0-9]"
                            },
                            "period_end": {
                              "type": "string",
                              "minLength": 5,
                              "maxLength": 5,
                              "pattern": "([0-1][0-9]|2[0-3]):[0-5][0-9]"
                            }
                          },
                          "required": [
                            "weekday",
                            "period_begin",
                            "period_end"
                          ],
                          "additionalProperties": false
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "twentyfourseven": {
                    "type": "boolean"
                  },
                  "exceptional_openings": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "period_begin": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "period_end": {
                              "type": "string",
                              "format": "date-time"
                            }
                          },
                          "required": [
                            "period_begin",
                            "period_end"
                          ],
                          "additionalProperties": false
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "exceptional_closings": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "$ref": "#/definitions/ocpi.2_2_1.locations/items/properties/opening_times/anyOf/0/properties/exceptional_openings/anyOf/0/items"
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "twentyfourseven"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "charging_when_closed": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "images": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/definitions/ocpi.2_2_1.locations/items/properties/evses/anyOf/0/items/properties/images/anyOf/0/items"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "energy_mix": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "is_green_energy": {
                    "type": "boolean"
                  },
                  "energy_sources": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "source": {
                              "type": "string",
                              "enum": [
                                "NUCLEAR",
                                "GENERAL_FOSSIL",
                                "COAL",
                                "GAS",
                                "GENERAL_GREEN",
                                "SOLAR",
                                "WIND",
                                "WATER"
                              ]
                            },
                            "percentage": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100
                            }
                          },
                          "required": [
                            "source",
                            "percentage"
                          ],
                          "additionalProperties": false
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "environ_impact": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "category": {
                              "type": "string",
                              "enum": [
                                "NUCLEAR_WASTE",
                                "CARBON_DIOXIDE"
                              ]
                            },
                            "amount": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "category",
                            "amount"
                          ],
                          "additionalProperties": false
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "supplier_name": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "energy_product_name": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "is_green_energy"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "last_updated": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "country_code",
          "party_id",
          "id",
          "publish",
          "address",
          "city",
          "country",
          "coordinates",
          "time_zone",
          "last_updated"
        ],
        "additionalProperties": false
      }
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#"
}