diff --git a/counterexamples/divisions/division/bad-names.yaml b/counterexamples/divisions/division/bad-names.yaml index 5fe5e3da..1827171a 100644 --- a/counterexamples/divisions/division/bad-names.yaml +++ b/counterexamples/divisions/division/bad-names.yaml @@ -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 diff --git a/examples/divisions/division/dependency.yaml b/examples/divisions/division/dependency.yaml index e3250ed4..7f044543 100644 --- a/examples/divisions/division/dependency.yaml +++ b/examples/divisions/division/dependency.yaml @@ -11,7 +11,7 @@ properties: version: 0 subtype: dependency local_type: - primary: territory + en: territory names: primary: Puerto Rico common: diff --git a/examples/divisions/division/hierarchies-multiple.yaml b/examples/divisions/division/hierarchies-multiple.yaml index 154113c0..62211468 100644 --- a/examples/divisions/division/hierarchies-multiple.yaml +++ b/examples/divisions/division/hierarchies-multiple.yaml @@ -11,7 +11,7 @@ properties: version: 0 subtype: borough local_type: - primary: borough + en: borough names: primary: The Bronx country: US diff --git a/examples/divisions/division/population.yaml b/examples/divisions/division/population.yaml index 76a25472..7c1c2017 100644 --- a/examples/divisions/division/population.yaml +++ b/examples/divisions/division/population.yaml @@ -11,7 +11,7 @@ properties: version: 0 subtype: region local_type: - primary: province + en: province names: primary: Ontario sources: diff --git a/examples/divisions/division/region.yaml b/examples/divisions/division/region.yaml index c04c45d6..e03c145e 100644 --- a/examples/divisions/division/region.yaml +++ b/examples/divisions/division/region.yaml @@ -11,7 +11,7 @@ properties: version: 0 subtype: region local_type: - primary: state + en: state names: primary: New York sources: diff --git a/schema/defs.yaml b/schema/defs.yaml index 49da6fbc..9ad2dbd2 100644 --- a/schema/defs.yaml +++ b/schema/defs.yaml @@ -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 @@ -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