Skip to content

Commit

Permalink
Merge pull request #24 from PDOK/PDOK-13230-int-test
Browse files Browse the repository at this point in the history
fix for WFS constraint
  • Loading branch information
arbakker authored Aug 20, 2021
2 parents 99c0784 + cfa115a commit 87161ed
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/wfs200/capabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@ type Constraint struct {
AllowedValues *AllowedValues `xml:"ows:AllowedValues" yaml:"allowedvalues"`
}

// when AllowedValues are defined, NoValues should not be present and vice versa
func (c Constraint) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
type constraint Constraint // prevent recursion
x := constraint(c)
if x.AllowedValues != nil {
x.NoValues = nil
} else {
s := ""
x.NoValues = &s
}
return e.EncodeElement(x, start)
}

// Operation struct for the WFS 2.0.0
type Operation struct {
Name string `xml:"name,attr"`
Expand Down

0 comments on commit 87161ed

Please sign in to comment.