Skip to content

Commit

Permalink
fix for WFS constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
arbakker committed Aug 20, 2021
1 parent 766085a commit cfa115a
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 cfa115a

Please sign in to comment.