Skip to content

Commit

Permalink
Validate uniqueness of values in Arrays of IDs (#102)
Browse files Browse the repository at this point in the history
* Unique values for vehicle_types.pricing_plan_ids

* Unique values for station_status.vehicle_type_ids

* Unique value for alerts.station_ids and region_ids

* Unique value for geofencing_zones.vehicle_type_ids

* Unique for station_information.vehicle_type_ids
  • Loading branch information
richfab authored Nov 20, 2023
1 parent 5d44652 commit b73b40f
Show file tree
Hide file tree
Showing 22 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions v1.0/system_alerts.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@
"station_ids": {
"description": "Array of identifiers of the stations for which this alert applies.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
},
"region_ids": {
"description": "Array of identifiers of the regions for which this alert applies.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
Expand Down
2 changes: 2 additions & 0 deletions v1.1/system_alerts.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"description":
"Array of identifiers of the stations for which this alert applies.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
Expand All @@ -79,6 +80,7 @@
"description":
"Array of identifiers of the regions for which this alert applies.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
Expand Down
2 changes: 2 additions & 0 deletions v2.0/system_alerts.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"description":
"Array of identifiers of the stations for which this alert applies.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
Expand All @@ -79,6 +80,7 @@
"description":
"Array of identifiers of the regions for which this alert applies.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
Expand Down
1 change: 1 addition & 0 deletions v2.1/geofencing_zones.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"properties": {
"vehicle_type_id": {
"type": "array",
"uniqueItems": true,
"description":
"Array of vehicle type IDs for which these restrictions apply.",
"items": { "type": "string" }
Expand Down
1 change: 1 addition & 0 deletions v2.1/station_status.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
"description":
"An array of strings where each string represents a vehicle_type_id that is able to use a particular type of dock at the station (added in v2.1-RC).",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
Expand Down
2 changes: 2 additions & 0 deletions v2.1/system_alerts.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"description":
"Array of identifiers of the stations for which this alert applies.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
Expand All @@ -79,6 +80,7 @@
"description":
"Array of identifiers of the regions for which this alert applies.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
Expand Down
1 change: 1 addition & 0 deletions v2.2/geofencing_zones.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"properties": {
"vehicle_type_id": {
"type": "array",
"uniqueItems": true,
"description":
"Array of vehicle type IDs for which these restrictions apply.",
"items": { "type": "string" }
Expand Down
1 change: 1 addition & 0 deletions v2.2/station_status.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
"description":
"An array of strings where each string represents a vehicle_type_id that is able to use a particular type of dock at the station (added in v2.1-RC).",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
Expand Down
2 changes: 2 additions & 0 deletions v2.2/system_alerts.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"description":
"Array of identifiers of the stations for which this alert applies.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
Expand All @@ -79,6 +80,7 @@
"description":
"Array of identifiers of the regions for which this alert applies.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
Expand Down
1 change: 1 addition & 0 deletions v2.3/geofencing_zones.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"properties": {
"vehicle_type_id": {
"type": "array",
"uniqueItems": true,
"description": "Array of vehicle type IDs for which these restrictions apply.",
"items": { "type": "string" }
},
Expand Down
1 change: 1 addition & 0 deletions v2.3/station_status.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
"description":
"An array of strings where each string represents a vehicle_type_id that is able to use a particular type of dock at the station (added in v2.1-RC).",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
Expand Down
2 changes: 2 additions & 0 deletions v2.3/system_alerts.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"description":
"Array of identifiers of the stations for which this alert applies.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
Expand All @@ -79,6 +80,7 @@
"description":
"Array of identifiers of the regions for which this alert applies.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
Expand Down
1 change: 1 addition & 0 deletions v2.3/vehicle_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@
"pricing_plan_ids": {
"description": "Array of all pricing plan IDs as defined in system_pricing_plans.json added in v2.3-RC.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
Expand Down
2 changes: 2 additions & 0 deletions v3.0-RC/geofencing_zones.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"properties": {
"vehicle_type_id": {
"type": "array",
"uniqueItems": true,
"description": "Array of vehicle type IDs for which these restrictions apply.",
"items": { "type": "string" }
},
Expand Down Expand Up @@ -167,6 +168,7 @@
"properties": {
"vehicle_type_id": {
"type": "array",
"uniqueItems": true,
"description": "Array of vehicle type IDs for which these restrictions apply.",
"items": { "type": "string" }
},
Expand Down
1 change: 1 addition & 0 deletions v3.0-RC/station_status.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
"description":
"An array of strings where each string represents a vehicle_type_id that is able to use a particular type of dock at the station (added in v2.1-RC).",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
Expand Down
2 changes: 2 additions & 0 deletions v3.0-RC/system_alerts.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"description":
"Array of identifiers of the stations for which this alert applies.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
Expand All @@ -82,6 +83,7 @@
"description":
"Array of identifiers of the regions for which this alert applies.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
Expand Down
1 change: 1 addition & 0 deletions v3.0-RC/vehicle_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@
"pricing_plan_ids": {
"description": "Array of all pricing plan IDs as defined in system_pricing_plans.json added in v2.3-RC.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
Expand Down
2 changes: 2 additions & 0 deletions v3.0-RC2/geofencing_zones.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"properties": {
"vehicle_type_ids": {
"type": "array",
"uniqueItems": true,
"description": "Array of vehicle type IDs for which these restrictions apply.",
"items": { "type": "string" }
},
Expand Down Expand Up @@ -162,6 +163,7 @@
"properties": {
"vehicle_type_ids": {
"type": "array",
"uniqueItems": true,
"description": "Array of vehicle type IDs for which these restrictions apply.",
"items": { "type": "string" }
},
Expand Down
2 changes: 2 additions & 0 deletions v3.0-RC2/station_information.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
"vehicle_type_ids": {
"description": "The vehicle_type_ids, as defined in vehicle_types.json, that may park at the virtual station.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
Expand All @@ -222,6 +223,7 @@
"vehicle_type_ids": {
"description": "An array of strings where each string represents a vehicle_type_id that is able to use a particular type of dock at the station.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
Expand Down
1 change: 1 addition & 0 deletions v3.0-RC2/station_status.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
"description":
"An array of strings where each string represents a vehicle_type_id that is able to use a particular type of dock at the station (added in v2.1-RC).",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
Expand Down
2 changes: 2 additions & 0 deletions v3.0-RC2/system_alerts.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"description":
"Array of identifiers of the stations for which this alert applies.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
Expand All @@ -83,6 +84,7 @@
"description":
"Array of identifiers of the regions for which this alert applies.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
Expand Down
1 change: 1 addition & 0 deletions v3.0-RC2/vehicle_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@
"pricing_plan_ids": {
"description": "Array of all pricing plan IDs as defined in system_pricing_plans.json added in v2.3-RC.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
Expand Down

0 comments on commit b73b40f

Please sign in to comment.