Skip to content

Commit

Permalink
Merge pull request #834 from openmobilityfoundation/feature-policy-im…
Browse files Browse the repository at this point in the history
…mutability

Added "Updating or Ending Policies" section
  • Loading branch information
schnuerle authored Feb 8, 2023
2 parents 7e35822 + 4789633 commit 9066711
Showing 1 changed file with 27 additions and 20 deletions.
47 changes: 27 additions & 20 deletions policy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ This specification describes the digital relationship between _mobility as a ser
## Table of Contents

- [General information](#general-information)
- [Background](#background)
- [Update Frequency](#update-frequency)
- [Updating or Ending Policies](#updating-or-ending-policies)
- [Versioning](#versioning)
- [Background](#background)
- [Distribution](#distribution)
- [Distribution](#distribution)
- [REST Endpoints](#rest-endpoints)
- [Responses and Error Messages](#responses-and-error-messages)
- [Authorization](#authorization)
Expand Down Expand Up @@ -53,21 +54,7 @@ The following information applies to all `policy` API endpoints.

[Top][toc]

### Update Frequency

The publishing agency should establish beforehand and communicate to providers how frequently the Policy endpoints are expected to change, how often they should be polled to get the latest information, and expectations around emergency updates.

[Top][toc]

### Versioning

`policy` APIs must handle requests for specific versions of the specification from clients.

Versioning must be implemented as specified in the [Versioning section][versioning].

[Top][toc]

## Background
### Background

The goal of the Policy API specification is to enable agencies to create, revise, and publish machine-readable policies, as sets of rules for individual and collective device behavior exhibited by both _mobility as a service_ providers and riders / users. [Examples](./examples/README.md) of policies include:

Expand All @@ -84,14 +71,34 @@ The machine-readable format allows Providers to obtain policies and compute comp

[Top][toc]

## Distribution
### Update Frequency

Policies shall be published by regulatory bodies or their authorized delegates as JSON objects. These JSON objects shall be served by either [flat files](#flat-files) or via [REST API endpoints](#rest-endpoints). In either case, policy data shall follow the [schema](#schema) outlined below.
The publishing agency should establish beforehand and communicate to providers how frequently the Policy endpoints are expected to change, how often they should be polled to get the latest information, and expectations around emergency updates.

Policies typically refer to one or more associated geographies. Geographic information is obtained from the MDS [Geography](/geography#general-information) API. Each policy and geography shall have a unique ID (UUID).
[Top][toc]

### Updating or Ending Policies

Published policies, like geographies, should be treated as immutable data. Obsoleting or otherwise changing a policy is accomplished by publishing a new policy with a field named `prev_policies`, a list of UUID references to the policy or policies superseded by the new policy.

To update a policy, create a new policy with the new rules rules, and list the now updated policy id in `prev_policies`.

To revoke or end a policy, create a new policy with empty rules, and list the ended policy id in `prev_policies`.

[Top][toc]

### Versioning

`policy` APIs must handle requests for specific versions of the specification from clients.

[Top][toc]

### Distribution

Policies shall be published by regulatory bodies or their authorized delegates as JSON objects. These JSON objects shall be served by either [flat files](#flat-files) or via [REST API endpoints](#rest-endpoints). In either case, policy data shall follow the [schema](#schema) outlined below.

Policies typically refer to one or more associated geographies. Geographic information is obtained from the MDS [Geography](/geography) API. Each policy and geography shall have a unique ID (UUID).

Geographical data shall be represented as GeoJSON `Feature` objects. No part of the geographical data should be outside the [municipality boundary][muni-boundary].

Policies should be re-fetched whenever:
Expand Down

0 comments on commit 9066711

Please sign in to comment.