Skip to content

Commit a3509b6

Browse files
authored
fix: falsely omitted fields in firewall schema (#396)
In the [API Docs](https://docs.hetzner.cloud/#firewalls-get-a-firewall) the `description`, `port`, `destination_ips` and `source_ips` properties are not marked as required (thus being optional) although in practice they are always set. This leads to inconsistencies between marshaled schemas and API responses. This PR modifies the schema so that it is consistent with the actual API output.
1 parent eaf649d commit a3509b6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

hcloud/schema/firewall.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ type Firewall struct {
1515
// FirewallRule defines the schema of a Firewall rule.
1616
type FirewallRule struct {
1717
Direction string `json:"direction"`
18-
SourceIPs []string `json:"source_ips,omitempty"`
19-
DestinationIPs []string `json:"destination_ips,omitempty"`
18+
SourceIPs []string `json:"source_ips"`
19+
DestinationIPs []string `json:"destination_ips"`
2020
Protocol string `json:"protocol"`
21-
Port *string `json:"port,omitempty"`
22-
Description *string `json:"description,omitempty"`
21+
Port *string `json:"port"`
22+
Description *string `json:"description"`
2323
}
2424

2525
// FirewallListResponse defines the schema of the response when listing Firewalls.

0 commit comments

Comments
 (0)