Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update city_schema.json #220

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,16 @@ Also please note that this is not valid JSON. Just an example for how the output
},
"name": "Altmarkt",
"total": 400,
"free": 235,
"state": "open|closed|nodata",
"free": 235, // >= 0, optional, can be missing, if no live data available
"state": "open|closed|nodata|unknown",
"id": "lot_id",
"forecast": true|false,
"region": "Region X", // optional
"address": "Musterstraße 5", // optional
"lot_type": "Parkhaus" // optional
"lot_type": "Parkhaus", // optional,
"opening_hours": "24/7", // optional, in OSM opening_hours syntax
"fee_hours": "Mo-Fr 07:00-22:00; PH off", // optional, in OSM opening_hours syntax
"url": "http://examplecity.com/parken/Altmarkt" // optional
},
...
}
Expand Down
190 changes: 124 additions & 66 deletions schema/city_schema.json
Original file line number Diff line number Diff line change
@@ -1,67 +1,125 @@
{
"$schema":"http://jkliemann.de/parkendd/media/city_schema.json",
"title":"ParkenDD JSON API",
"description":"JSON required by ParkenDD app to show parking lots",
"type":"array",
"items":{
"type":"object",
"properties":{
"name":{
"description":"Name of parking lot category",
"type":"string"
},
"lots":{
"description":"Parking lots in this category",
"type":"array",
"items":{
"type":"object",
"properties":{
"name":{
"description":"Name of parking lot",
"type":"string"
},
"count":{
"description":"Count of available parking lots",
"type":"integer"
},
"free":{
"description":"Count of free parking lots",
"type":"integer"
},
"state":{
"description":"State of the parking lot",
"type":"string",
"enum":["nodata","closed","many","few","full"]
},
"lat":{
"description":"latitude of the parking lot",
"type":"string"
},
"lon":{
"description":"longitude of the parking lot",
"type":"string"
},
"forecast":{
"description":"shows if forecast is available for this spot",
"type":"boolean"
},
"url":{
"description":"A URL of a web resource where more information can be viewed",
"type":"string"
},
"opening_hours":{
"description":"Opening hours of this lot in OpenStreetMap format (https://wiki.openstreetmap.org/wiki/Key:opening_hours)",
"type":"string"
},
"fee_hours":{
"description":"Hours during which usage of this lot incurrs fees in OpenStreetMap format (https://wiki.openstreetmap.org/wiki/Key:opening_hours). It is implied that outside those hours usage is free.",
"type":"string"
}
},
"required":["name", "count", "state", "forecast"]
}
}
},
"required":["name", "lots"]
}
}
"$schema": "http://jkliemann.de/parkendd/media/city_schema.json",
"title": "ParkenDD JSON API",
"description": "JSON required by ParkenDD app to show parking lots",
"type": "object",
"properties": {
"last_downloaded": {
"type": "string",
"format": "date-time"
},
"last_updated": {
"type": "string",
"format": "date-time"
},
"lots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"address": {
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"coords": {
"oneOf": [
{
"type": "object",
"properties": {
"lat": {
"type": "number",
"minimum": -90,
"maximum": 90
},
"lng": {
"type": "number",
"minimum": -180,
"maximum": 180
}
}
},
{
"type": "null"
}
]
},
"forecast": {
"type": "boolean"
},
"free": {
"type": "integer",
"minimum": 0
},
"id": {
"type": "string"
},
"lot_type": {
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"name": {
"type": "string"
},
"region": {
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"state": {
"enum": [
"open",
"nodata",
"closed",
"unknown"
]
},
"total": {
"type": "integer",
"minimum": 0
},
"opening_hours": {
"type": "string"
},
"fee_hours": {
"type": "string"
},
"url": {
"type": "string",
"format": "uri"
}
},
"required": [
"forecast",
"id",
"name",
"state",
"total"
],
"additionalProperties": true
}
}
},
"required": [
"last_downloaded",
"last_updated",
"lots"
],
"additionalProperties": true
}