Skip to content

Commit cfee5bf

Browse files
authored
Merge pull request #534 from openmobilityfoundation/reconciled-schemas
Reconciled JSON schemas
2 parents 8912442 + 22db940 commit cfee5bf

23 files changed

Lines changed: 3045 additions & 2483 deletions

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
.venv/
1+
.venv/
2+
.vscode
3+
__pycache__

agency/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ See the [Responses][responses] and [Error Messages][error-messages] sections.
3232

3333
### Authorization
3434

35-
When making requests, the Agency API expects `provider_id` to be part of the claims in a [JWT](https://jwt.io/) `access_token` in the `Authorization` header, in the form `Authorization: Bearer <access_token>`. The token issuance, expiration and revocation policies are at the discretion of the Agency.
35+
When making requests, the Agency API expects `provider_id` to be part of the claims in a [JWT](https://jwt.io/) `access_token` in the `Authorization` header, in the form `Authorization: Bearer <access_token>`. The token issuance, expiration and revocation policies are at the discretion of the Agency.
3636

3737
## Vehicles
3838

39-
The `/vehicles` endpoint returns the specified vehicle (if a device_id is provided) or a list of known vehicles. Providers can only retrieve data for vehicles in their registered fleet.
39+
The `/vehicles` endpoint returns the specified vehicle (if a device_id is provided) or a list of known vehicles. Providers can only retrieve data for vehicles in their registered fleet.
4040

4141
Endpoint: `/vehicles/{device_id}`
4242
Method: `GET`
@@ -70,13 +70,13 @@ A vehicle record is as follows:
7070
| `device_id` | UUID | Provided by Operator to uniquely identify a vehicle |
7171
| `provider_id` | UUID | Issued by Agency and [tracked](../providers.csv) |
7272
| `vehicle_id` | String | Vehicle Identification Number (vehicle_id) visible on vehicle |
73-
| `type` | Enum | [Vehicle Type][vehicle-types] |
74-
| `propulsion` | Enum[] | Array of [Propulsion Type][propulsion-types]; allows multiple values |
73+
| `vehicle_type` | Enum | [Vehicle Type][vehicle-types] |
74+
| `propulsion_types` | Enum[] | Array of [Propulsion Type][propulsion-types]; allows multiple values |
7575
| `year` | Integer | Year Manufactured |
7676
| `mfgr` | String | Vehicle Manufacturer |
7777
| `model` | String | Vehicle Model |
7878
| `state` | Enum | Current vehicle state. See [Vehicle State][vehicle-states] |
79-
| `prev_event` | Enum | Last [Vehicle Event][vehicle-event] |
79+
| `prev_events` | Enum[] | Last [Vehicle Event][vehicle-event] |
8080
| `updated` | [timestamp][ts] | Date of last event update |
8181

8282
404 Failure Response:
@@ -96,8 +96,8 @@ Body Params:
9696
| ------------ | ------- | ----------------- | -------------------------------------------------------------------- |
9797
| `device_id` | UUID | Required | Provided by Operator to uniquely identify a vehicle |
9898
| `vehicle_id` | String | Required | Vehicle Identification Number (vehicle_id) visible on vehicle |
99-
| `type` | Enum | Required | [Vehicle Type][vehicle-types] |
100-
| `propulsion` | Enum[] | Required | Array of [Propulsion Type][propulsion-types]; allows multiple values |
99+
| `vehicle_type` | Enum | Required | [Vehicle Type][vehicle-types] |
100+
| `propulsion_types` | Enum[] | Required | Array of [Propulsion Type][propulsion-types]; allows multiple values |
101101
| `provider_id`| UUID | Optional | Provider to which the vehicle belongs if different from the authenticated provider |
102102
| `year` | Integer | Optional | Year Manufactured |
103103
| `mfgr` | String | Optional | Vehicle Manufacturer |
@@ -122,7 +122,7 @@ _No content returned on success._
122122

123123
## Vehicle - Update
124124

125-
The `/vehicles` update endpoint is used to update some mutable aspect of a vehicle. For now, only `vehicle_id`.
125+
The `/vehicles` update endpoint is used to update some mutable aspect of a vehicle. For now, only `vehicle_id`.
126126

127127
Endpoint: `/vehicles/{device_id}`
128128
Method: `PUT`
@@ -169,7 +169,7 @@ Body Params:
169169
| `event_types` | Enum[] | Required | see [Vehicle Events][vehicle-events] |
170170
| `timestamp` | [timestamp][ts] | Required | Date of last event update |
171171
| `telemetry` | [Telemetry](#telemetry-data) | Required | Single point of telemetry |
172-
| `trip_id` | UUID | Optional | UUID provided by Operator to uniquely identify the trip. Required for `trip_start`, `trip_end`, `trip_enter`, and `trip_leave` event types |
172+
| `trip_id` | UUID | Optional | UUID provided by Operator to uniquely identify the trip. Required if `event_types` contains `trip_start`, `trip_end`, `trip_cancel`, `trip_enter_jurisdiction`, or `trip_leave_jurisdiction` |
173173

174174
201 Success Response:
175175

0 commit comments

Comments
 (0)