Skip to content

Commit 2fe0540

Browse files
ericgodwinCopilot
andcommitted
refactor: use SnakeCaseString and NoWhitespaceString for source fields
Replace inline regex patterns with the existing system string types: - provider: SnakeCaseString (^[a-z0-9]+(_[a-z0-9]+)*$) - resource: SnakeCaseString (^[a-z0-9]+(_[a-z0-9]+)*$) - version: NoWhitespaceString (^\S+$) Update example to use underscores instead of hyphens for resource names (e.g., ml_buildings instead of ml-buildings). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: ericgodwin <eric@overturemaps.org>
1 parent 0fefe80 commit 2fe0540

18 files changed

Lines changed: 75 additions & 73 deletions

File tree

examples/buildings/sources-with-version.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ properties:
1717
- property: "/properties/name"
1818
dataset: metaML-buildings
1919
provider: meta
20-
resource: ml-buildings
20+
resource: ml_buildings
2121
version: 'abcdef'
2222
- property: "/properties/height"
2323
dataset: microsoft-buildings

packages/overture-schema-addresses-theme/tests/address_baseline_schema.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@
5555
"type": "string"
5656
},
5757
"provider": {
58-
"description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).",
58+
"description": "The provider label for the entity that contributed this data\n(e.g., osm, meta, esri).",
5959
"minLength": 1,
60-
"pattern": "^[a-z0-9][a-z0-9._-]*$",
60+
"pattern": "^[a-z0-9]+(_[a-z0-9]+)*$",
6161
"title": "Provider",
6262
"type": "string"
6363
},
@@ -67,9 +67,9 @@
6767
"type": "string"
6868
},
6969
"resource": {
70-
"description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).",
70+
"description": "The subject or type of data contributed by the provider\n(e.g., planet, buildings, division_names).",
7171
"minLength": 1,
72-
"pattern": "^[a-z0-9][a-z0-9._-]*$",
72+
"pattern": "^[a-z0-9]+(_[a-z0-9]+)*$",
7373
"title": "Resource",
7474
"type": "string"
7575
},

packages/overture-schema-base-theme/tests/bathymetry_baseline_schema.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@
7676
"type": "string"
7777
},
7878
"provider": {
79-
"description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).",
79+
"description": "The provider label for the entity that contributed this data\n(e.g., osm, meta, esri).",
8080
"minLength": 1,
81-
"pattern": "^[a-z0-9][a-z0-9._-]*$",
81+
"pattern": "^[a-z0-9]+(_[a-z0-9]+)*$",
8282
"title": "Provider",
8383
"type": "string"
8484
},
@@ -88,9 +88,9 @@
8888
"type": "string"
8989
},
9090
"resource": {
91-
"description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).",
91+
"description": "The subject or type of data contributed by the provider\n(e.g., planet, buildings, division_names).",
9292
"minLength": 1,
93-
"pattern": "^[a-z0-9][a-z0-9._-]*$",
93+
"pattern": "^[a-z0-9]+(_[a-z0-9]+)*$",
9494
"title": "Resource",
9595
"type": "string"
9696
},

packages/overture-schema-base-theme/tests/infrastructure_baseline_schema.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,9 +385,9 @@
385385
"type": "string"
386386
},
387387
"provider": {
388-
"description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).",
388+
"description": "The provider label for the entity that contributed this data\n(e.g., osm, meta, esri).",
389389
"minLength": 1,
390-
"pattern": "^[a-z0-9][a-z0-9._-]*$",
390+
"pattern": "^[a-z0-9]+(_[a-z0-9]+)*$",
391391
"title": "Provider",
392392
"type": "string"
393393
},
@@ -397,9 +397,9 @@
397397
"type": "string"
398398
},
399399
"resource": {
400-
"description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).",
400+
"description": "The subject or type of data contributed by the provider\n(e.g., planet, buildings, division_names).",
401401
"minLength": 1,
402-
"pattern": "^[a-z0-9][a-z0-9._-]*$",
402+
"pattern": "^[a-z0-9]+(_[a-z0-9]+)*$",
403403
"title": "Resource",
404404
"type": "string"
405405
},

packages/overture-schema-base-theme/tests/land_baseline_schema.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,9 @@
258258
"type": "string"
259259
},
260260
"provider": {
261-
"description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).",
261+
"description": "The provider label for the entity that contributed this data\n(e.g., osm, meta, esri).",
262262
"minLength": 1,
263-
"pattern": "^[a-z0-9][a-z0-9._-]*$",
263+
"pattern": "^[a-z0-9]+(_[a-z0-9]+)*$",
264264
"title": "Provider",
265265
"type": "string"
266266
},
@@ -270,9 +270,9 @@
270270
"type": "string"
271271
},
272272
"resource": {
273-
"description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).",
273+
"description": "The subject or type of data contributed by the provider\n(e.g., planet, buildings, division_names).",
274274
"minLength": 1,
275-
"pattern": "^[a-z0-9][a-z0-9._-]*$",
275+
"pattern": "^[a-z0-9]+(_[a-z0-9]+)*$",
276276
"title": "Resource",
277277
"type": "string"
278278
},

packages/overture-schema-base-theme/tests/land_cover_baseline_schema.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@
9393
"type": "string"
9494
},
9595
"provider": {
96-
"description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).",
96+
"description": "The provider label for the entity that contributed this data\n(e.g., osm, meta, esri).",
9797
"minLength": 1,
98-
"pattern": "^[a-z0-9][a-z0-9._-]*$",
98+
"pattern": "^[a-z0-9]+(_[a-z0-9]+)*$",
9999
"title": "Provider",
100100
"type": "string"
101101
},
@@ -105,9 +105,9 @@
105105
"type": "string"
106106
},
107107
"resource": {
108-
"description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).",
108+
"description": "The subject or type of data contributed by the provider\n(e.g., planet, buildings, division_names).",
109109
"minLength": 1,
110-
"pattern": "^[a-z0-9][a-z0-9._-]*$",
110+
"pattern": "^[a-z0-9]+(_[a-z0-9]+)*$",
111111
"title": "Resource",
112112
"type": "string"
113113
},

packages/overture-schema-base-theme/tests/land_use_baseline_schema.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,9 @@
336336
"type": "string"
337337
},
338338
"provider": {
339-
"description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).",
339+
"description": "The provider label for the entity that contributed this data\n(e.g., osm, meta, esri).",
340340
"minLength": 1,
341-
"pattern": "^[a-z0-9][a-z0-9._-]*$",
341+
"pattern": "^[a-z0-9]+(_[a-z0-9]+)*$",
342342
"title": "Provider",
343343
"type": "string"
344344
},
@@ -348,9 +348,9 @@
348348
"type": "string"
349349
},
350350
"resource": {
351-
"description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).",
351+
"description": "The subject or type of data contributed by the provider\n(e.g., planet, buildings, division_names).",
352352
"minLength": 1,
353-
"pattern": "^[a-z0-9][a-z0-9._-]*$",
353+
"pattern": "^[a-z0-9]+(_[a-z0-9]+)*$",
354354
"title": "Resource",
355355
"type": "string"
356356
},

packages/overture-schema-base-theme/tests/water_baseline_schema.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,9 @@
189189
"type": "string"
190190
},
191191
"provider": {
192-
"description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).",
192+
"description": "The provider label for the entity that contributed this data\n(e.g., osm, meta, esri).",
193193
"minLength": 1,
194-
"pattern": "^[a-z0-9][a-z0-9._-]*$",
194+
"pattern": "^[a-z0-9]+(_[a-z0-9]+)*$",
195195
"title": "Provider",
196196
"type": "string"
197197
},
@@ -201,9 +201,9 @@
201201
"type": "string"
202202
},
203203
"resource": {
204-
"description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).",
204+
"description": "The subject or type of data contributed by the provider\n(e.g., planet, buildings, division_names).",
205205
"minLength": 1,
206-
"pattern": "^[a-z0-9][a-z0-9._-]*$",
206+
"pattern": "^[a-z0-9]+(_[a-z0-9]+)*$",
207207
"title": "Resource",
208208
"type": "string"
209209
},

packages/overture-schema-buildings-theme/tests/building_baseline_schema.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,9 @@
372372
"type": "string"
373373
},
374374
"provider": {
375-
"description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).",
375+
"description": "The provider label for the entity that contributed this data\n(e.g., osm, meta, esri).",
376376
"minLength": 1,
377-
"pattern": "^[a-z0-9][a-z0-9._-]*$",
377+
"pattern": "^[a-z0-9]+(_[a-z0-9]+)*$",
378378
"title": "Provider",
379379
"type": "string"
380380
},
@@ -384,9 +384,9 @@
384384
"type": "string"
385385
},
386386
"resource": {
387-
"description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).",
387+
"description": "The subject or type of data contributed by the provider\n(e.g., planet, buildings, division_names).",
388388
"minLength": 1,
389-
"pattern": "^[a-z0-9][a-z0-9._-]*$",
389+
"pattern": "^[a-z0-9]+(_[a-z0-9]+)*$",
390390
"title": "Resource",
391391
"type": "string"
392392
},

packages/overture-schema-buildings-theme/tests/building_part_baseline_schema.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,9 @@
258258
"type": "string"
259259
},
260260
"provider": {
261-
"description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).",
261+
"description": "The provider label for the entity that contributed this data\n(e.g., osm, meta, esri).",
262262
"minLength": 1,
263-
"pattern": "^[a-z0-9][a-z0-9._-]*$",
263+
"pattern": "^[a-z0-9]+(_[a-z0-9]+)*$",
264264
"title": "Provider",
265265
"type": "string"
266266
},
@@ -270,9 +270,9 @@
270270
"type": "string"
271271
},
272272
"resource": {
273-
"description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).",
273+
"description": "The subject or type of data contributed by the provider\n(e.g., planet, buildings, division_names).",
274274
"minLength": 1,
275-
"pattern": "^[a-z0-9][a-z0-9._-]*$",
275+
"pattern": "^[a-z0-9]+(_[a-z0-9]+)*$",
276276
"title": "Resource",
277277
"type": "string"
278278
},

0 commit comments

Comments
 (0)