Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete primary sub-property from division's local_type #139

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion counterexamples/divisions/division/bad-names.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ properties:
norms:
driving_side: left
ext_expected_errors:
- "[I#/properties/names/primary] [S#/$defs/propertyDefinitions/commonNames/properties/primary/type] expected string, but got null"
- "[I#/properties/names/primary] [S#/$defs/propertyDefinitions/allNames/properties/primary/type] expected string, but got null"
- additionalProperties 'a-b-c-d-e-f-g-h-i-j-k-l' not allowed
2 changes: 1 addition & 1 deletion examples/divisions/division/dependency.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ properties:
version: 0
subtype: dependency
local_type:
primary: territory
en: territory
names:
primary: Puerto Rico
common:
Expand Down
2 changes: 1 addition & 1 deletion examples/divisions/division/hierarchies-multiple.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ properties:
version: 0
subtype: borough
local_type:
primary: borough
en: borough
names:
primary: The Bronx
country: US
Expand Down
2 changes: 1 addition & 1 deletion examples/divisions/division/population.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ properties:
version: 0
subtype: region
local_type:
primary: province
en: province
names:
primary: Ontario
sources:
Expand Down
2 changes: 1 addition & 1 deletion examples/divisions/division/region.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ properties:
version: 0
subtype: region
local_type:
primary: state
en: state
names:
primary: New York
sources:
Expand Down
31 changes: 13 additions & 18 deletions schema/defs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,13 @@ description: Common schema definitions shared by all themes
type: object
required: [primary]
unevaluatedProperties: false
allOf:
- { "$ref": "#/$defs/propertyDefinitions/commonNames" }
properties:
primary:
description: The most commonly used name.
type: string
minLength: 1
pattern: ^(\S.*)?\S$ # Leading and trailing whitespace are not allowed.
common: { "$ref": "#/$defs/propertyDefinitions/commonNames" }
rules:
description: >-
Rules for names that cannot be specified in the simple
Expand All @@ -220,26 +224,17 @@ description: Common schema definitions shared by all themes
items: { "$ref": "#/$defs/propertyDefinitions/nameRule" }
minItems: 1
commonNames:
description: The common translations of the name.
type: object
required: [primary]
properties:
primary:
description: The most commonly used name.
minProperties: 1
additionalProperties: false
patternProperties:
"^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-[a-zA-Z]{2})?$":
"$comment": >-
This is an incomplete pattern for BCP47 language tags.
type: string
minLength: 1
pattern: ^(\S.*)?\S$ # Leading and trailing whitespace are not allowed.
common:
description: The common translations of the name.
type: object
minProperties: 1
additionalProperties: false
patternProperties:
"^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-[a-zA-Z]{2})?$":
"$comment": >-
This is an incomplete pattern for BCP47 language tags.
type: string
minLength: 1
pattern: ^(\S.*)?\S$ # Leading and trailing whitespace are not allowed.
iso3166_1Alpha2CountryCode:
description: ISO 3166-1 alpha-2 country code.
type: string
Expand Down
Loading