From 482ab11de6170a70cb07a6c14869dd06cd4194ee Mon Sep 17 00:00:00 2001 From: Juan Hernandez Date: Tue, 25 Jan 2022 16:17:17 +0100 Subject: [PATCH] Update to metamodel 0.0.50 The more relevant changes in the new version of the metamodel are the following: - Fix format of date query parameters so that it is RFC3339. Signed-off-by: Juan Hernandez --- Makefile | 2 +- helpers/helpers.go | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5ad9c5d4f..f0c4f4184 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ model_version:=v0.0.169 model_url:=https://github.com/openshift-online/ocm-api-model.git # Details of the metamodel to use: -metamodel_version:=v0.0.49 +metamodel_version:=v0.0.50 .PHONY: examples examples: diff --git a/helpers/helpers.go b/helpers/helpers.go index e95777f85..b5083f049 100644 --- a/helpers/helpers.go +++ b/helpers/helpers.go @@ -34,7 +34,14 @@ func AddValue(query *url.Values, name string, value interface{}) { if *query == nil { *query = make(url.Values) } - query.Add(name, fmt.Sprintf("%v", value)) + var text string + switch typed := value.(type) { + case time.Time: + text = typed.UTC().Format(time.RFC3339) + default: + text = fmt.Sprintf("%v", value) + } + query.Add(name, text) } // CopyQuery creates a copy of the given set of query parameters.