From a3509b6b0f2762b5d1e27f2374d3fb5fb53206e2 Mon Sep 17 00:00:00 2001 From: phm07 <22707808+phm07@users.noreply.github.com> Date: Wed, 27 Mar 2024 15:59:40 +0100 Subject: [PATCH] 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. --- hcloud/schema/firewall.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hcloud/schema/firewall.go b/hcloud/schema/firewall.go index 371e648f..5fc93124 100644 --- a/hcloud/schema/firewall.go +++ b/hcloud/schema/firewall.go @@ -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.