Skip to content

Commit 9066711

Browse files
authored
Merge pull request #834 from openmobilityfoundation/feature-policy-immutability
Added "Updating or Ending Policies" section
2 parents 7e35822 + 4789633 commit 9066711

1 file changed

Lines changed: 27 additions & 20 deletions

File tree

policy/README.md

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ This specification describes the digital relationship between _mobility as a ser
99
## Table of Contents
1010

1111
- [General information](#general-information)
12+
- [Background](#background)
1213
- [Update Frequency](#update-frequency)
14+
- [Updating or Ending Policies](#updating-or-ending-policies)
1315
- [Versioning](#versioning)
14-
- [Background](#background)
15-
- [Distribution](#distribution)
16+
- [Distribution](#distribution)
1617
- [REST Endpoints](#rest-endpoints)
1718
- [Responses and Error Messages](#responses-and-error-messages)
1819
- [Authorization](#authorization)
@@ -53,21 +54,7 @@ The following information applies to all `policy` API endpoints.
5354

5455
[Top][toc]
5556

56-
### Update Frequency
57-
58-
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.
59-
60-
[Top][toc]
61-
62-
### Versioning
63-
64-
`policy` APIs must handle requests for specific versions of the specification from clients.
65-
66-
Versioning must be implemented as specified in the [Versioning section][versioning].
67-
68-
[Top][toc]
69-
70-
## Background
57+
### Background
7158

7259
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:
7360

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

8572
[Top][toc]
8673

87-
## Distribution
74+
### Update Frequency
8875

89-
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.
76+
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.
9077

91-
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).
78+
[Top][toc]
79+
80+
### Updating or Ending Policies
9281

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

84+
To update a policy, create a new policy with the new rules rules, and list the now updated policy id in `prev_policies`.
85+
86+
To revoke or end a policy, create a new policy with empty rules, and list the ended policy id in `prev_policies`.
87+
88+
[Top][toc]
89+
90+
### Versioning
91+
92+
`policy` APIs must handle requests for specific versions of the specification from clients.
93+
94+
[Top][toc]
95+
96+
### Distribution
97+
98+
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.
99+
100+
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).
101+
95102
Geographical data shall be represented as GeoJSON `Feature` objects. No part of the geographical data should be outside the [municipality boundary][muni-boundary].
96103

97104
Policies should be re-fetched whenever:

0 commit comments

Comments
 (0)