Skip to content

Commit

Permalink
Remove "value" as required element of address_level (#283)
Browse files Browse the repository at this point in the history
* Allow address_levels to be null

* Update doc

* Refactor to remove "value" as required element of address level container

* Update documentation description

* Fix missing null level
  • Loading branch information
jwass authored Oct 2, 2024
1 parent 3ef238e commit e376796
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
17 changes: 17 additions & 0 deletions examples/addresses/address_all_missing_address_levels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
id: overture:addresses:addres:1
type: Feature
geometry:
type: Point
coordinates: [-71.2086153, 42.3373725]
properties:
theme: addresses
type: address
version: 0
country: US
address_levels:
- {}
- {}
postcode: '02459'
street: COMMONWEALTH AVE
number: '1000'
17 changes: 17 additions & 0 deletions examples/addresses/address_missing_address_level.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
id: overture:addresses:addres:1
type: Feature
geometry:
type: Point
coordinates: [-71.2086153, 42.3373725]
properties:
theme: addresses
type: address
version: 0
country: US
address_levels:
- value: MA
- {}
postcode: '02459'
street: COMMONWEALTH AVE
number: '1000'
6 changes: 5 additions & 1 deletion schema/addresses/address.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ properties: # JSON Schema: Top-level object properties.
and the municipality. In other countries there might be only one.
Other countries could have three or more. The array is ordered
with the highest levels first.
Note: when a level is not known - most likely because the data provider
has not supplied it and we have not derived it from another source,
the array element container must be present, but the "value" field
should be omitted
type: array
items: { "$ref": "#/$defs/propertyContainers/addressLevelContainer" }
minItems: 1
Expand All @@ -76,7 +81,6 @@ properties: # JSON Schema: Top-level object properties.
levels with per-country rules indicating which parts of a country's
address goes to which numbered level.
type: object
required: ["value"]
properties:
value:
type: string
Expand Down

0 comments on commit e376796

Please sign in to comment.