From 93b693cbdf24fa13f4b1ebe690ea157c50d87342 Mon Sep 17 00:00:00 2001 From: Mike Del Tito Date: Wed, 6 Dec 2023 12:50:08 -0500 Subject: [PATCH] fix(http): update supported and default decoding method `auto` is the new default on the API side, this change updates the provider to match. Ref: LOG-18800 --- internal/provider/models/sources/http.go | 5 ++--- internal/provider/models/sources/test/http_test.go | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/internal/provider/models/sources/http.go b/internal/provider/models/sources/http.go index 8eb1d4d3..8d4ae8aa 100644 --- a/internal/provider/models/sources/http.go +++ b/internal/provider/models/sources/http.go @@ -33,11 +33,10 @@ var HttpSourceResourceSchema = schema.Schema{ Required: false, Optional: true, Computed: true, - Default: stringdefault.StaticString("json"), + Default: stringdefault.StaticString("auto"), Description: "The decoding method for converting frames into data events.", Validators: []validator.String{ - stringvalidator.OneOf( - "bytes", "json", "ndjson"), + stringvalidator.OneOf("bytes", "json", "ndjson", "auto"), }, }, }, []string{"capture_metadata", "gateway_route_id"}), diff --git a/internal/provider/models/sources/test/http_test.go b/internal/provider/models/sources/test/http_test.go index af8df6d7..b0acf462 100644 --- a/internal/provider/models/sources/test/http_test.go +++ b/internal/provider/models/sources/test/http_test.go @@ -49,7 +49,7 @@ func TestHttpSource(t *testing.T) { "description": "my http description", "generation_id": "0", "title": "my http title", - "decoding": "json", + "decoding": "auto", "capture_metadata": "false", "pipeline_id": "#mezmo_pipeline.test_parent.id", }), @@ -112,7 +112,7 @@ func TestHttpSource(t *testing.T) { "description": "This source provides gateway_route_id", "generation_id": "0", "title": "A shared http source", - "decoding": "json", + "decoding": "auto", "capture_metadata": "false", "pipeline_id": "#mezmo_pipeline.test_parent.id", "gateway_route_id": "#mezmo_http_source.parent_source.gateway_route_id",