Skip to content

Commit

Permalink
fix: falsely omitted fields in firewall schema (#396)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
phm07 authored Mar 27, 2024
1 parent eaf649d commit a3509b6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hcloud/schema/firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ type Firewall struct {
// FirewallRule defines the schema of a Firewall rule.
type FirewallRule struct {
Direction string `json:"direction"`
SourceIPs []string `json:"source_ips,omitempty"`
DestinationIPs []string `json:"destination_ips,omitempty"`
SourceIPs []string `json:"source_ips"`
DestinationIPs []string `json:"destination_ips"`
Protocol string `json:"protocol"`
Port *string `json:"port,omitempty"`
Description *string `json:"description,omitempty"`
Port *string `json:"port"`
Description *string `json:"description"`
}

// FirewallListResponse defines the schema of the response when listing Firewalls.
Expand Down

0 comments on commit a3509b6

Please sign in to comment.