From 32e8a8cc3de868a59be7e5ae4fb9feea874f2331 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Tue, 2 May 2023 11:32:24 +0200 Subject: Types Discovery: Omitempty for some types that are not always there This makes sure that instead of "authentication_url_template": "" we get not even an "authentication_url_template" key This matches the upstream discovery format more 1:1 --- types/discovery/discovery.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/discovery/discovery.go b/types/discovery/discovery.go index 0d3495a..bc22eab 100644 --- a/types/discovery/discovery.go +++ b/types/discovery/discovery.go @@ -49,17 +49,17 @@ type Servers struct { // Server is a signle discovery server type Server struct { // AuthenticationURLTemplate is the template to be used for authentication to skip WAYF - AuthenticationURLTemplate string `json:"authentication_url_template"` + AuthenticationURLTemplate string `json:"authentication_url_template,omitempty"` // BaseURL is the base URL of the server which is used as an identifier for the server by the Go library BaseURL string `json:"base_url"` // CountryCode is the country code for the server in case of secure internet, e.g. NL - CountryCode string `json:"country_code"` + CountryCode string `json:"country_code,omitempty"` // DisplayName is the display name of the server, omitted if empty DisplayName MapOrString `json:"display_name,omitempty"` // DisplayName are the keywords of the server, omitted if empty KeywordList MapOrString `json:"keyword_list,omitempty"` // PublicKeyList are the public keys of the server. Currently not used in this lib but returned by the upstream discovery server - PublicKeyList []string `json:"public_key_list"` + PublicKeyList []string `json:"public_key_list,omitempty"` // Type is the type of the server, "secure_internet" or "institute_access" Type string `json:"server_type"` // SupportContact is the list/slice of support contacts -- cgit v1.2.3