Skip to content

Commit

Permalink
Merge pull request #534 from openmobilityfoundation/reconciled-schemas
Browse files Browse the repository at this point in the history
Reconciled JSON schemas
  • Loading branch information
schnuerle committed Jun 29, 2020
2 parents 8912442 + 22db940 commit cfee5bf
Show file tree
Hide file tree
Showing 23 changed files with 3,045 additions and 2,483 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.venv/
.venv/
.vscode
__pycache__
18 changes: 9 additions & 9 deletions agency/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ See the [Responses][responses] and [Error Messages][error-messages] sections.

### Authorization

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.
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.

## Vehicles

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.
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.

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

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

## Vehicle - Update

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

Endpoint: `/vehicles/{device_id}`
Method: `PUT`
Expand Down Expand Up @@ -169,7 +169,7 @@ Body Params:
| `event_types` | Enum[] | Required | see [Vehicle Events][vehicle-events] |
| `timestamp` | [timestamp][ts] | Required | Date of last event update |
| `telemetry` | [Telemetry](#telemetry-data) | Required | Single point of telemetry |
| `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 |
| `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` |

201 Success Response:

Expand Down
Loading

0 comments on commit cfee5bf

Please sign in to comment.