Skip to content

Commit

Permalink
fix: constrain geometry type to "Polygon" (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
rosvik authored Oct 11, 2024
1 parent de25f6f commit 874230b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions schema-definitions/referenceData.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@
"type": "object",
"properties": {
"type": {
"type": "string"
"type": "string",
"const": "Polygon"
},
"coordinates": {
"type": "array",
Expand Down Expand Up @@ -272,7 +273,8 @@
"type": "object",
"properties": {
"type": {
"type": "string"
"type": "string",
"const": "Polygon"
},
"coordinates": {
"type": "array",
Expand Down
4 changes: 2 additions & 2 deletions src/reference-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const TariffZone = z.object({
name: LanguageAndTextType,
version: z.string(),
geometry: z.object({
type: z.string(),
type: z.literal('Polygon'),
coordinates: z.array(z.array(z.array(z.number()).length(2))),
}),
description: LanguageAndTextTypeArray.optional(),
Expand All @@ -47,7 +47,7 @@ export const CityZone = z.object({
orderUrl: LanguageAndTextTypeArray.optional(),
phoneNumber: z.string().optional(),
geometry: z.object({
type: z.string(),
type: z.literal('Polygon'),
coordinates: z.array(z.array(z.array(z.number()).length(2))),
}),
});
Expand Down

0 comments on commit 874230b

Please sign in to comment.