Skip to content

Commit 0686385

Browse files
committed
types
1 parent 11e15d7 commit 0686385

File tree

2 files changed

+29
-25
lines changed

2 files changed

+29
-25
lines changed

api/v3/shared_types.go

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,37 +58,38 @@ type Mapfile struct {
5858
ConfigMapKeyRef corev1.ConfigMapKeySelector `json:"configMapKeyRef"`
5959
}
6060

61+
// TODO GedefaultOptions
6162
// Options configures optional behaviors of the operator, like ingress, casing, and data prefetching.
6263
// +kubebuilder:validation:Type=object
6364
type Options struct {
6465
// IncludeIngress dictates whether to deploy an Ingress or ensure none exists.
6566
// +kubebuilder:default:=true
66-
IncludeIngress bool `json:"includeIngress"`
67+
IncludeIngress bool `json:"includeIngress,omitempty"`
6768

6869
// AutomaticCasing enables automatic conversion from snake_case to camelCase.
6970
// +kubebuilder:default:=true
70-
AutomaticCasing bool `json:"automaticCasing"`
71+
AutomaticCasing bool `json:"automaticCasing,omitempty"`
7172

7273
// ValidateRequests enables request validation against the service schema.
7374
// +kubebuilder:default:=true
74-
ValidateRequests *bool `json:"validateRequests,omitempty"`
75+
ValidateRequests bool `json:"validateRequests,omitempty"`
7576

7677
// RewriteGroupToDataLayers merges group layers into individual data layers.
7778
// +kubebuilder:default:=false
78-
RewriteGroupToDataLayers *bool `json:"rewriteGroupToDataLayers,omitempty"`
79+
RewriteGroupToDataLayers bool `json:"rewriteGroupToDataLayers,omitempty"`
7980

8081
// DisableWebserviceProxy disables the built-in proxy for external web services.
8182
// +kubebuilder:default:=false
82-
DisableWebserviceProxy *bool `json:"disableWebserviceProxy,omitempty"`
83+
DisableWebserviceProxy bool `json:"disableWebserviceProxy,omitempty"`
8384

8485
// Whether to prefetch data from blob storage, and store it on the local filesystem.
8586
// If `false`, the data will be served directly out of blob storage
8687
// +kubebuilder:default:=true
87-
PrefetchData *bool `json:"prefetchData,omitempty"`
88+
PrefetchData bool `json:"prefetchData,omitempty"`
8889

8990
// ValidateChildStyleNameEqual ensures child style names match the parent style.
9091
// +kubebuilder:default=false
91-
ValidateChildStyleNameEqual *bool `json:"validateChildStyleNameEqual,omitempty"`
92+
ValidateChildStyleNameEqual bool `json:"validateChildStyleNameEqual,omitempty"`
9293
}
9394

9495
// Inspire holds INSPIRE-specific metadata for the service.
@@ -107,8 +108,9 @@ type Inspire struct {
107108
Language string `json:"language"`
108109
}
109110

111+
// TODO one of the two, not both
110112
type MetadataURL struct {
111-
// CSW describes a metadata record via a metadataIdentifier (UUID).
113+
// CSW describes a metadata record via a metadataIdentifier (UUID) as defined in the OwnerInfo.
112114
CSW *Metadata `json:"csw"`
113115

114116
// Custom allows arbitrary href
@@ -195,16 +197,19 @@ type TIF struct {
195197
// +kubebuilder:validation:MinLength:=1
196198
BlobKey string `json:"blobKey"`
197199

198-
// Resample method
200+
// TODO pattern: "(NEAREST|AVERAGE|BILINEAR)"
201+
// "This option can be used to control the resampling kernel used sampling raster images, optional"
199202
// +kubebuilder:validation:MinLength:=1
200203
Resample *string `json:"resample,omitempty"`
201204

202-
// Offsite color for nodata removal
205+
// TODO pattern: '(#[0-9A-F]{2}[0-9A-F]{2}[0-9A-F]{2}([0-9A-F]{2})?)|([0-9]{1,3}\s[0-9]{1,3}\s[0-9]{1,3})'
206+
// "Sets the color index to treat as transparent for raster layers, optional"
203207
// +kubebuilder:validation:MinLength:=1
204208
Offsite *string `json:"offsite,omitempty"`
205209

206-
// Include class names in GetFeatureInfo responses
207-
GetFeatureInfoIncludesClass *bool `json:"getFeatureInfoIncludesClass,omitempty"`
210+
// TODO default false
211+
// "When a band represents nominal or ordinal data the class name (from styling) can be included in the getFeatureInfo"
212+
GetFeatureInfoIncludesClass bool `json:"getFeatureInfoIncludesClass,omitempty"`
208213
}
209214

210215
// Column maps a source column name to an optional alias for output.

api/v3/wms_types.go

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,10 @@ type WMSService struct {
8484
// +kubebuilder:validation:MinLength:=1
8585
OwnerInfoRef string `json:"ownerInfoRef"`
8686

87-
// TODO ??
88-
// +kubebuilder:validation:MinLength:=1
89-
Fees *string `json:"fees,omitempty"`
90-
9187
// AccessConstraints (licence) that are applicable to the service
9288
// +kubebuilder:validation:Pattern:=`https?://.*`
9389
// +kubebuilder:default="https://creativecommons.org/publicdomain/zero/1.0/deed.nl"
94-
AccessConstraints *string `json:"accessConstraints,omitempty"`
95-
96-
// TODO??
97-
MaxSize *int32 `json:"maxSize,omitempty"`
90+
AccessConstraints string `json:"accessConstraints,omitempty"`
9891

9992
// Optional specification Inspire themes and ids
10093
Inspire *Inspire `json:"inspire,omitempty"`
@@ -104,10 +97,13 @@ type WMSService struct {
10497
//nolint:tagliatelle
10598
DataEPSG string `json:"dataEPSG"`
10699

107-
// TODO ??
100+
// Mapfile setting: Sets the maximum size (in pixels) for both dimensions of the image from a getMap request.
101+
MaxSize *int32 `json:"maxSize,omitempty"`
102+
103+
// Mapfile setting: Sets the RESOLUTION field in the mapfile, not used when service.mapfile is configured
108104
Resolution *int32 `json:"resolution,omitempty"`
109105

110-
// TODO ??
106+
// Mapfile setting: Sets the DEFRESOLUTION field in the mapfile, not used when service.mapfile is configured
111107
DefResolution *int32 `json:"defResolution,omitempty"`
112108

113109
// Optional. Required files for the styling of the service
@@ -139,6 +135,7 @@ type ConfigMapRef struct {
139135

140136
// +kubebuilder:validation:XValidation:message="A layer should have sublayers or data, not both", rule="(has(self.data) || has(self.layers)) && !(has(self.data) && has(self.layers))"
141137
// +kubebuilder:validation:XValidation:message="A layer should have keywords when visible", rule="!self.visible || has(self.keywords)"
138+
// TODO copy above for title, abstract, authority, datasetmetadaturl,
142139
type Layer struct {
143140
// Name of the layer, required for layers on the 2nd or 3rd level
144141
// +kubebuilder:validations:MinLength:=1
@@ -157,11 +154,12 @@ type Layer struct {
157154
Keywords []string `json:"keywords,omitempty"`
158155

159156
// BoundingBoxes of the layer. If omitted the boundingboxes of the parent layer of the service is used.
157+
// +kubebuilder:validations:MinItems:=1
160158
BoundingBoxes []WMSBoundingBox `json:"boundingBoxes,omitempty"`
161159

162160
// Whether or not the layer is visible. At least one of the layers must be visible.
163161
// +kubebuilder:default:=true
164-
Visible *bool `json:"visible,omitempty"`
162+
Visible bool `json:"visible,omitempty"`
165163

166164
// TODO ??
167165
Authority *Authority `json:"authority,omitempty"`
@@ -181,13 +179,14 @@ type Layer struct {
181179
// +kubebuilder:validations:MinItems:=1
182180
Styles []Style `json:"styles,omitempty"`
183181

184-
// TODO ??
182+
// Mapfile setting, sets "LABEL_NO_CLIP=ON"
185183
LabelNoClip bool `json:"labelNoClip,omitempty"`
186184

187185
// Data (gpkg/postgis/tif) used by the layer
188186
Data *Data `json:"data,omitempty"`
189187

190188
// Sublayers of the layer
189+
// +kubebuilder:validations:MinItems:=1
191190
Layers []Layer `json:"layers,omitempty"`
192191
}
193192

@@ -229,7 +228,7 @@ type Style struct {
229228
Legend *Legend `json:"legend,omitempty"`
230229
}
231230

232-
// TODO add validations + descriptions
231+
// TODO add validations + descriptions, omitempty, defaults, behalve blobkey
233232
type Legend struct {
234233
Width int32 `json:"width"`
235234
Height int32 `json:"height"`

0 commit comments

Comments
 (0)