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

Fix missing validation bug in names rules #277

Merged
merged 1 commit into from
Sep 17, 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
3 changes: 3 additions & 0 deletions counterexamples/common/names/names-invalid-language.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ properties:
rules:
- language: etymology:wikidata
value: Not allowed to have a colon
variant: common
- language: etymology
value: Too long
variant: alternate
- language: pronunciation
value: Too long
variant: official
ext_expected_errors:
- "additionalProperties 'zh_pinyin', 'en1', 'ja_rm' not allowed"
- "[I#/properties/names/rules/0/language] [S#/$defs/propertyDefinitions/language/pattern] does not match pattern"
Expand Down
22 changes: 22 additions & 0 deletions counterexamples/common/names/names-invalid-variant.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
id: names-invalid-variant
type: Feature
geometry:
type: LineString
coordinates: [[0, 0], [1, 1]]
properties:
theme: transportation
type: segment
version: 1
subtype: road
class: primary
names:
primary: Bar
rules:
- value: I am missing the variant
- language: en-us
value: I have a fake/unsupported variant
variant: fake-variant
ext_expected_errors:
- "'/properties/names/rules/0': missing property 'variant'"
- "'/properties/names/rules/1/variant': value must be one of 'common', 'official', 'alternate', 'short'"
2 changes: 2 additions & 0 deletions examples/common/names/names-lexically-valid-language-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ properties:
rules:
- language: be-Latn
value: Use this instead of be-tarask.
variant: common
- language: ja-Latn
value: Use this instead of ja_rm.
variant: alternate
2 changes: 1 addition & 1 deletion schema/defs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ description: Common schema definitions shared by all themes
5. *("-" extension)
nameRule:
type: object
required: [value]
required: [variant, value]
allOf:
- { "$ref": "#/$defs/propertyContainers/geometricRangeScopeContainer" }
- { "$ref": "#/$defs/propertyContainers/sideScopeContainer" }
Expand Down
Loading