@@ -38,7 +38,7 @@ func (gc GetCapabilitiesResponse) ToXML() []byte {
3838
3939// GetCapabilitiesResponse base struct
4040type GetCapabilitiesResponse struct {
41- XMLName xml.Name `xml:"WFS_Capabilities"`
41+ XMLName xml.Name `xml:"WFS_Capabilities" yaml:"-" `
4242 Namespaces `yaml:"namespaces"`
4343 ServiceIdentification ServiceIdentification `xml:"ows:ServiceIdentification" yaml:"serviceIdentification"`
4444 ServiceProvider ServiceProvider `xml:"ows:ServiceProvider" yaml:"serviceProvider"`
@@ -62,13 +62,13 @@ type Namespaces struct {
6262
6363// ServiceIdentification struct should only be filled by the "template" configuration wfs200.yaml
6464type ServiceIdentification struct {
65- XMLName xml.Name `xml:"ows:ServiceIdentification"`
65+ XMLName xml.Name `xml:"ows:ServiceIdentification" yaml:"-" `
6666 Title string `xml:"ows:Title" yaml:"title"`
6767 Abstract string `xml:"ows:Abstract" yaml:"abstract"`
6868 Keywords * wsc110.Keywords `xml:"ows:Keywords" yaml:"keywords"`
69- ServiceType ServiceType `xml:"ows:ServiceType" yaml:"serviceType"`
70- ServiceTypeVersion string `xml:"ows:ServiceTypeVersion" yaml:"serviceTypeVersion"`
71- Fees string `xml:"ows:Fees" yaml:"fees"`
69+ ServiceType * ServiceType `xml:"ows:ServiceType" yaml:"serviceType,omitempty "`
70+ ServiceTypeVersion * string `xml:"ows:ServiceTypeVersion" yaml:"serviceTypeVersion,omitempty "`
71+ Fees * string `xml:"ows:Fees" yaml:"fees,omitempty "`
7272 AccessConstraints string `xml:"ows:AccessConstraints" yaml:"accessConstraints"`
7373}
7474
@@ -80,10 +80,10 @@ type ServiceType struct {
8080
8181// ServiceProvider struct containing the provider/organization information should only be fill by the "template" configuration wfs200.yaml
8282type ServiceProvider struct {
83- XMLName xml.Name `xml:"ows:ServiceProvider"`
84- ProviderName string `xml:"ows:ProviderName" yaml:"providerName"`
85- ProviderSite ProviderSite `xml:"ows:ProviderSite" yaml:"providerSite"`
86- ServiceContact ServiceContact `xml:"ows:ServiceContact" yaml:"serviceContact"`
83+ XMLName xml.Name `xml:"ows:ServiceProvider" yaml:"- "`
84+ ProviderName * string `xml:"ows:ProviderName" yaml:"providerName,omitempty "`
85+ ProviderSite * ProviderSite `xml:"ows:ProviderSite" yaml:"providerSite,omitempty "`
86+ ServiceContact * ServiceContact `xml:"ows:ServiceContact" yaml:"serviceContact,omitempty "`
8787}
8888
8989// ProviderSite struct containing the website of the provider/organization
@@ -94,40 +94,40 @@ type ProviderSite struct {
9494
9595// ServiceContact struct containing information for the person to contact
9696type ServiceContact struct {
97- IndividualName string `xml:"ows:IndividualName" yaml:"individualName"`
98- PositionName string `xml:"ows:PositionName" yaml:"positionName"`
99- ContactInfo ContactInfo `xml:"ows:ContactInfo" yaml:"contactInfo"`
100- Role string `xml:"ows:Role" yaml:"role"`
97+ IndividualName * string `xml:"ows:IndividualName" yaml:"individualName,omitempty "`
98+ PositionName * string `xml:"ows:PositionName" yaml:"positionName,omitempty "`
99+ ContactInfo * ContactInfo `xml:"ows:ContactInfo" yaml:"contactInfo,omitempty "`
100+ Role * string `xml:"ows:Role" yaml:"role,omitempty "`
101101}
102102
103103// ContactInfo struct containing the contact information for the service
104104type ContactInfo struct {
105- Text string `xml:",chardata"`
106- Phone Phone `xml:"ows:Phone" yaml:"phone"`
107- Address Address `xml:"ows:Address" yaml:"address"`
108- OnlineResource OnlineResource `xml:"ows:OnlineResource" yaml:"onlineResource"`
109- HoursOfService string `xml:"ows:HoursOfService" yaml:"hoursOfService"`
110- ContactInstructions string `xml:"ows:ContactInstructions" yaml:"contactInstructions"`
105+ Text * string `xml:",chardata" yaml:"text,omitempty "`
106+ Phone * Phone `xml:"ows:Phone" yaml:"phone,omitempty "`
107+ Address * Address `xml:"ows:Address" yaml:"address,omitempty "`
108+ OnlineResource * OnlineResource `xml:"ows:OnlineResource" yaml:"onlineResource,omitempty "`
109+ HoursOfService * string `xml:"ows:HoursOfService" yaml:"hoursOfService,omitempty "`
110+ ContactInstructions * string `xml:"ows:ContactInstructions" yaml:"contactInstructions,omitempty "`
111111}
112112
113113// Phone struct containing the contact telephone or fax number
114114type Phone struct {
115- Voice string `xml:"ows:Voice" yaml:"voice"`
116- Facsimile string `xml:"ows:Facsimile" yaml:"facsimile"`
115+ Voice * string `xml:"ows:Voice" yaml:"voice"`
116+ Facsimile * string `xml:"ows:Facsimile" yaml:"facsimile,omitempty "`
117117}
118118
119119// Address struct containing the address for the contact supplying the service
120120type Address struct {
121- DeliveryPoint string `xml:"ows:DeliveryPoint" yaml:"deliveryPoint"`
122- City string `xml:"ows:City" yaml:"city"`
123- AdministrativeArea string `xml:"ows:AdministrativeArea" yaml:"administrativeArea"`
124- PostalCode string `xml:"ows:PostalCode" yaml:"postalCode"`
125- Country string `xml:"ows:Country" yaml:"country"`
126- ElectronicMailAddress string `xml:"ows:ElectronicMailAddress" yaml:"electronicMailAddress"`
121+ DeliveryPoint * string `xml:"ows:DeliveryPoint" yaml:"deliveryPoint,omitempty "`
122+ City * string `xml:"ows:City" yaml:"city,omitempty "`
123+ AdministrativeArea * string `xml:"ows:AdministrativeArea" yaml:"administrativeArea,omitempty "`
124+ PostalCode * string `xml:"ows:PostalCode" yaml:"postalCode,omitempty "`
125+ Country * string `xml:"ows:Country" yaml:"country,omitempty "`
126+ ElectronicMailAddress * string `xml:"ows:ElectronicMailAddress" yaml:"electronicMailAddress,omitempty "`
127127}
128128
129129// OnlineResource struct containing the top-level web address of a service or service provider
130130type OnlineResource struct {
131- Type string `xml:"xlink:type,attr" yaml:"type"`
132- Href string `xml:"xlink:href,attr" yaml:"href"`
131+ Type * string `xml:"xlink:type,attr" yaml:"type,omitempty "`
132+ Href * string `xml:"xlink:href,attr" yaml:"href,omitempty "`
133133}
0 commit comments