Skip to content

Commit

Permalink
Ran grunt
Browse files Browse the repository at this point in the history
  • Loading branch information
datengraben committed Mar 8, 2024
1 parent 9493bfe commit af6c19a
Show file tree
Hide file tree
Showing 6 changed files with 307 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"$schema": "http://json-schema.org/schema#",
"$id": "https://github.com/wielebenwir/commons-api/blob/master/commons-api.availability.schema.json",
"title": "Commons Api Availability Schema",
"description": "A schema for availability slots of the Commons API",
"definitions": {
"availabilitySlot": {
"type": "object",
"description": "A time slot at which an item can be booked at a certain location.",
"properties": {
"start": {
"type": "string",
"format": "date-time"
},
"end": {
"type": "string",
"format": "date-time"
},
"locationId": {
"type": "string"
},
"itemId": {
"type": "string"
}
},
"required": ["start", "end", "locationId", "itemId"]
}
},
"type": "object",
"properties": {
"availability": {
"type": "array",
"descriptions": "An array with the availability slots for bookable items.",
"items": { "$ref": "#/definitions/availabilitySlot" },
"uniqueItems": true
}
},
"required": ["availability"]
}
72 changes: 72 additions & 0 deletions includes/commons-api-json-schema/commons-api.items.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"$schema": "http://json-schema.org/schema#",
"$id": "https://github.com/wielebenwir/commons-api/blob/master/commons-api.items.schema.json",
"title": "Commons Api Items Schema",
"description": "A schema for items that can be booked",
"definitions": {
"item": {
"type": "object",
"properties": {
"id": { "type": "string" },
"name": { "type": "string" },
"url": {
"type": "string",
"format": "uri"
},
"image": {
"type": "string",
"format": "uri"
},
"description": { "type": "string" },
"ownerId": { "type": "string" },
"projectId": { "type": "string" }
},
"required": ["id", "name", "url", "ownerId", "projectId"]
}
},
"type": "object",
"properties": {
"items": {
"type": "array",
"description": "The items that can be booked on this site.",
"items": { "$ref": "#/definitions/item" },
"uniqueItems": true
},
"availability": {
"type": "array",
"items": {
"$ref": "https://github.com/wielebenwir/commons-api/blob/master/commons-api.availability.schema.json#/definitions/availabilitySlot"
},
"uniqueItems": true
},
"locations": {
"type": "object",
"required": ["type", "features"],
"properties": {
"type": { "type": "string", "enum": ["FeatureCollection"] },
"features": {
"type": "array",
"items": {
"$ref": "https://github.com/wielebenwir/commons-api/blob/master/commons-api.locations.schema.json#/definitions/location"
},
"uniqueItems": true
}
}
},
"owners": {
"type": "array",
"items": {
"$ref": "https://github.com/wielebenwir/commons-api/blob/master/commons-api.owners.schema.json#/definitions/owner"
},
"uniqueItems": true
},
"projects": {
"type": "array",
"items": {
"$ref": "https://github.com/wielebenwir/commons-api/blob/master/commons-api.projects.schema.json#/definitions/project"
},
"uniqueItems": true
}
},
"required": ["items"]
}
63 changes: 63 additions & 0 deletions includes/commons-api-json-schema/commons-api.locations.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"$schema": "http://json-schema.org/schema#",
"$id": "https://github.com/wielebenwir/commons-api/blob/master/commons-api.locations.schema.json",
"title": "Commons Api Locations Schema",
"description": "A schema for item locations of the Commons API",
"definitions": {
"location": {
"type": "object",
"description": "A GeoJson feature describing a location at which users can pick up items.",
"properties": {
"type": { "type": "string", "enum": ["Feature"] },
"properties": {
"type": "object",
"description": "The properties of the location",
"properties": {
"id": { "type": "string" },
"name": { "type": "string" },
"description": { "type": "string" },
"url": {
"type": "string",
"format": "uri"
},
"address": { "type": "string" }
},
"required": ["name", "id"]
},
"geometry": {
"type": "object",
"description": "A GeoJson point, containing the coordinates of the location",
"required": ["type", "coordinates"],
"properties": {
"type": { "type": "string", "enum": ["Point"] },
"coordinates": {
"type": "array",
"minItems": 2,
"items": {
"type": "number"
}
}
}
}
},
"required": ["type", "properties", "geometry"]
}
},
"type": "object",
"properties": {
"locations": {
"type": "object",
"description": "A GeoJson feature collection of the locations at which users can pick up items.",
"required": ["type", "features"],
"properties": {
"type": { "type": "string", "enum": ["FeatureCollection"] },
"features": {
"type": "array",
"items": { "$ref": "#/definitions/location" },
"uniqueItems": true
}
}
}
},
"required": ["locations"]
}
32 changes: 32 additions & 0 deletions includes/commons-api-json-schema/commons-api.owners.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"$schema": "http://json-schema.org/schema#",
"$id": "https://github.com/wielebenwir/commons-api/blob/master/commons-api.owners.schema.json",
"title": "Commons Api Owners Schema",
"description": "A schema for item owners of the Commons API",
"definitions": {
"owner": {
"type": "object",
"properties": {
"id": { "type": "string" },
"name": {
"type": "string"
},
"url": {
"type": "string",
"format": "uri"
}
},
"required": ["name", "id"]
}
},
"type": "object",
"properties": {
"owners": {
"type": "array",
"descriptions": "An array with the item owners as values.",
"items": { "$ref": "#/definitions/owner" },
"uniqueItems": true
}
},
"required": ["locations"]
}
34 changes: 34 additions & 0 deletions includes/commons-api-json-schema/commons-api.projects.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$schema": "http://json-schema.org/schema#",
"$id": "https://github.com/wielebenwir/commons-api/blob/master/commons-api.projects.schema.json",
"title": "Commons Api Projects Schema",
"description": "A schema for projects of the Commons API",
"definitions": {
"project": {
"type": "object",
"description": "The project that organizes the lending of the items",
"properties": {
"id": { "type": "string" },
"name": { "type": "string" },
"url": {
"type": "string",
"format": "uri"
},
"description": { "type": "string" },
"image": { "type": "string", "format": "uri" },
"language": { "type": "string" }
},
"required": ["id", "name", "url"]
}
},
"type": "object",
"properties": {
"projects": {
"type": "array",
"descriptions": "An array with the item projects as values.",
"items": { "$ref": "#/definitions/project" },
"uniqueItems": true
}
},
"required": ["projects"]
}
67 changes: 67 additions & 0 deletions includes/commons-api-json-schema/velogistics-api.items.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"$schema": "http://json-schema.org/schema#",
"$id": "https://github.com/wielebenwir/commons-api/blob/master/velogistics-api.schema.json",
"title": "Velogistics Api",
"description": "Extension of the Commons Api for cargo bikes",
"allOf": [
{
"$ref": "https://github.com/wielebenwir/commons-api/blob/master/commons-api.items.schema.json"
},
{
"type": "object",
"properties": {
"publishOnVelogistics": {
"type": "boolean"
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"itemType": {
"type": "string"
},
"features": {
"type": "array",
"items": {
"type": "string"
}
},
"isCommercial": {
"type": "boolean"
},
"nrOfWheels": {
"type": "integer",
"minimum": 0
},
"seatsForChildren": {
"type": "integer",
"minimum": 0
},
"loadCapacity": {
"type": "number"
},
"boxDimensions": {
"type": "object",
"properties": {
"length": { "type": "number" },
"width": { "type": "number" },
"height": { "type": "number" }
}
},
"bikeDimensions": {
"type": "object",
"properties": {
"length": { "type": "number" },
"width": { "type": "number" },
"height": { "type": "number" }
}
}
}
},
"uniqueItems": true
}
}
}
]
}

0 comments on commit af6c19a

Please sign in to comment.