Skip to content

Commit bb95a0a

Browse files
committed
WFS markers added
1 parent 7c0707f commit bb95a0a

File tree

2 files changed

+127
-24
lines changed

2 files changed

+127
-24
lines changed

api/v3/wfs_types.go

Lines changed: 89 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -66,36 +66,80 @@ func init() {
6666

6767
// WFSSpec vertegenwoordigt de hoofdstruct voor de YAML-configuratie
6868
type WFSSpec struct {
69+
// Optional lifecycle settings
6970
Lifecycle *shared_model.Lifecycle `json:"lifecycle,omitempty"`
7071
// +kubebuilder:validation:Type=object
7172
// +kubebuilder:validation:Schemaless
7273
// +kubebuilder:pruning:PreserveUnknownFields
7374
// Optional strategic merge patch for the pod in the deployment. E.g. to patch the resources or add extra env vars.
75+
7476
PodSpecPatch *corev1.PodSpec `json:"podSpecPatch,omitempty"`
7577
HorizontalPodAutoscalerPatch *autoscalingv2.HorizontalPodAutoscalerSpec `json:"horizontalPodAutoscalerPatch,omitempty"`
7678
Options Options `json:"options,omitempty"`
77-
Service WFSService `json:"service"`
79+
80+
// service configuration
81+
// +kubebuilder:validation:Required
82+
Service WFSService `json:"service"`
7883
}
7984

8085
type WFSService struct {
8186
// Geonovum subdomein
8287
// +kubebuilder:validation:MinLength:=1
83-
Prefix string `json:"prefix"`
84-
URL string `json:"url"`
85-
Inspire *Inspire `json:"inspire,omitempty"`
86-
Mapfile *Mapfile `json:"mapfile,omitempty"`
87-
OwnerInfoRef string `json:"ownerInfoRef"`
88-
Title string `json:"title"`
89-
Abstract string `json:"abstract"`
90-
Keywords []string `json:"keywords"`
91-
Fees *string `json:"fees,omitempty"`
88+
Prefix string `json:"prefix"`
89+
90+
// URL of the service
91+
// +kubebuilder:validation:Pattern:=`^https?://.*$`
92+
URL string `json:"url"`
93+
94+
// check for Inspire services
95+
// +kubebuilder:default="false"
96+
Inspire *Inspire `json:"inspire,omitempty"`
97+
98+
// External Mapfile reference
99+
Mapfile *Mapfile `json:"mapfile,omitempty"`
100+
101+
// Reference to OwnerInfo CR
102+
// TODO no webhook yet?
103+
// +kubebuilder:validation:MinLength:=1
104+
OwnerInfoRef string `json:"ownerInfoRef"`
105+
106+
// Service title
107+
// +kubebuilder:validation:MinLength:=1
108+
Title string `json:"title"`
109+
110+
// Service abstract
111+
// +kubebuilder:validation:MinLength:=1
112+
Abstract string `json:"abstract"`
113+
114+
// Keywords for capabilities
115+
// +kubebuilder:validation:MinItems:=1
116+
Keywords []string `json:"keywords"`
117+
118+
// Optional Fees
119+
Fees *string `json:"fees,omitempty"`
120+
121+
// AccessConstraints URL
122+
// +kubebuilder:validation:Pattern:="https?://"
92123
// +kubebuilder:default="https://creativecommons.org/publicdomain/zero/1.0/deed.nl"
93-
AccessConstraints string `json:"accessConstraints"`
94-
DefaultCrs string `json:"defaultCrs"`
95-
OtherCrs []string `json:"otherCrs,omitempty"`
96-
Bbox *Bbox `json:"bbox,omitempty"`
124+
AccessConstraints string `json:"accessConstraints"`
125+
126+
// Default CRS (DataEPSG)
127+
// +kubebuilder:validation:Pattern:="^EPSG:(28992|25831|25832|3034|3035|3857|4258|4326)$"
128+
// +kubebuilder:validation:MinLength:=1
129+
DefaultCrs string `json:"defaultCrs"`
130+
131+
// Other supported CRS
132+
OtherCrs []string `json:"otherCrs,omitempty"`
133+
134+
// Service bounding box
135+
Bbox *Bbox `json:"bbox,omitempty"`
136+
97137
// CountDefault -> wfs_maxfeatures in mapfile
98-
CountDefault *string `json:"countDefault,omitempty"`
138+
// +kubebuilder:validation:MinLength:=1
139+
CountDefault *string `json:"countDefault,omitempty"`
140+
141+
// FeatureTypes configurations
142+
// +kubebuilder:validation:MinItems:=1
99143
FeatureTypes []FeatureType `json:"featureTypes"`
100144
}
101145

@@ -105,14 +149,37 @@ type Bbox struct {
105149
DefaultCRS shared_model.BBox `json:"defaultCRS"`
106150
}
107151

152+
// FeatureType defines a WFS feature
153+
// +kubebuilder:validation:Required
108154
type FeatureType struct {
109-
Name string `json:"name"`
110-
Title string `json:"title"`
111-
Abstract string `json:"abstract"`
112-
Keywords []string `json:"keywords"`
113-
DatasetMetadataURL MetadataURL `json:"datasetMetadataUrl"`
114-
Bbox *FeatureBbox `json:"bbox,omitempty"`
115-
Data Data `json:"data"`
155+
// Name of the feature
156+
// +kubebuilder:validation:MinLength:=1
157+
Name string `json:"name"`
158+
159+
// Title of the feature
160+
// +kubebuilder:validation:MinLength:=1
161+
Title string `json:"title"`
162+
163+
// Abstract of the feature
164+
// +kubebuilder:validation:MinLength:=1
165+
Abstract string `json:"abstract"`
166+
167+
// Keywords of the feature
168+
// +kubebuilder:validation:MinItems:=1
169+
Keywords []string `json:"keywords"`
170+
171+
// Metadata URL
172+
// +kubebuilder:validation:Type=object
173+
DatasetMetadataURL MetadataURL `json:"datasetMetadataUrl"`
174+
175+
// Optional feature bbox
176+
// +kubebuilder:validation:Optional
177+
// +kubebuilder:validation:Type:=object
178+
Bbox *FeatureBbox `json:"bbox,omitempty"`
179+
180+
// Featuretype data connection
181+
// +kubebuilder:validation:Required
182+
Data Data `json:"data"`
116183
}
117184

118185
type FeatureBbox struct {

config/crd/bases/pdok.nl_wfs.yaml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,7 @@ spec:
10861086
- scaleTargetRef
10871087
type: object
10881088
lifecycle:
1089+
description: Optional lifecycle settings
10891090
properties:
10901091
ttlInDays:
10911092
format: int32
@@ -1118,18 +1119,22 @@ spec:
11181119
- includeIngress
11191120
type: object
11201121
podSpecPatch:
1121-
description: Optional strategic merge patch for the pod in the deployment.
1122-
E.g. to patch the resources or add extra env vars.
11231122
type: object
11241123
x-kubernetes-preserve-unknown-fields: true
11251124
service:
1125+
description: service configuration
11261126
properties:
11271127
abstract:
1128+
description: Service abstract
1129+
minLength: 1
11281130
type: string
11291131
accessConstraints:
11301132
default: https://creativecommons.org/publicdomain/zero/1.0/deed.nl
1133+
description: AccessConstraints URL
1134+
pattern: https?://
11311135
type: string
11321136
bbox:
1137+
description: Service bounding box
11331138
properties:
11341139
defaultCRS:
11351140
description: EXTENT/wfs_extent in mapfile
@@ -1161,15 +1166,24 @@ spec:
11611166
type: object
11621167
countDefault:
11631168
description: CountDefault -> wfs_maxfeatures in mapfile
1169+
minLength: 1
11641170
type: string
11651171
defaultCrs:
1172+
description: Default CRS (DataEPSG)
1173+
minLength: 1
1174+
pattern: ^EPSG:(28992|25831|25832|3034|3035|3857|4258|4326)$
11661175
type: string
11671176
featureTypes:
1177+
description: FeatureTypes configurations
11681178
items:
1179+
description: FeatureType defines a WFS feature
11691180
properties:
11701181
abstract:
1182+
description: Abstract of the feature
1183+
minLength: 1
11711184
type: string
11721185
bbox:
1186+
description: Optional feature bbox
11731187
properties:
11741188
defaultCRS:
11751189
description: BBox defines a bounding box with coordinates
@@ -1225,6 +1239,7 @@ spec:
12251239
- defaultCRS
12261240
type: object
12271241
data:
1242+
description: Featuretype data connection
12281243
properties:
12291244
gpkg:
12301245
properties:
@@ -1290,6 +1305,7 @@ spec:
12901305
type: object
12911306
type: object
12921307
datasetMetadataUrl:
1308+
description: Metadata URL
12931309
properties:
12941310
csw:
12951311
properties:
@@ -1312,12 +1328,18 @@ spec:
13121328
- csw
13131329
type: object
13141330
keywords:
1331+
description: Keywords of the feature
13151332
items:
13161333
type: string
1334+
minItems: 1
13171335
type: array
13181336
name:
1337+
description: Name of the feature
1338+
minLength: 1
13191339
type: string
13201340
title:
1341+
description: Title of the feature
1342+
minLength: 1
13211343
type: string
13221344
required:
13231345
- abstract
@@ -1327,10 +1349,14 @@ spec:
13271349
- name
13281350
- title
13291351
type: object
1352+
minItems: 1
13301353
type: array
13311354
fees:
1355+
description: Optional Fees
13321356
type: string
13331357
inspire:
1358+
default: "false"
1359+
description: check for Inspire services
13341360
properties:
13351361
language:
13361362
type: string
@@ -1364,10 +1390,13 @@ spec:
13641390
- spatialDatasetIdentifier
13651391
type: object
13661392
keywords:
1393+
description: Keywords for capabilities
13671394
items:
13681395
type: string
1396+
minItems: 1
13691397
type: array
13701398
mapfile:
1399+
description: External Mapfile reference
13711400
properties:
13721401
configMapKeyRef:
13731402
description: Selects a key from a ConfigMap.
@@ -1396,18 +1425,25 @@ spec:
13961425
- configMapKeyRef
13971426
type: object
13981427
otherCrs:
1428+
description: Other supported CRS
13991429
items:
14001430
type: string
14011431
type: array
14021432
ownerInfoRef:
1433+
description: Reference to OwnerInfo CR
1434+
minLength: 1
14031435
type: string
14041436
prefix:
14051437
description: Geonovum subdomein
14061438
minLength: 1
14071439
type: string
14081440
title:
1441+
description: Service title
1442+
minLength: 1
14091443
type: string
14101444
url:
1445+
description: URL of the service
1446+
pattern: ^https?://.*$
14111447
type: string
14121448
required:
14131449
- abstract

0 commit comments

Comments
 (0)