From d2414f89f19adbfb3d156e459363770c7964eeeb Mon Sep 17 00:00:00 2001 From: Ashley Jeffs Date: Fri, 1 Mar 2024 18:32:40 +0000 Subject: [PATCH] Fix non-generalised docs defaults --- internal/httpserver/cors.go | 2 +- internal/template/config.go | 2 +- internal/tls/docs.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/httpserver/cors.go b/internal/httpserver/cors.go index 953fd780fe..b074f9f125 100644 --- a/internal/httpserver/cors.go +++ b/internal/httpserver/cors.go @@ -48,7 +48,7 @@ func (conf CORSConfig) WrapHandler(handler http.Handler) (http.Handler, error) { func ServerCORSFieldSpec() docs.FieldSpec { return docs.FieldObject(fieldCORS, "Adds Cross-Origin Resource Sharing headers.").WithChildren( docs.FieldBool(fieldCORSEnabled, "Whether to allow CORS requests.").HasDefault(false), - docs.FieldString(fieldCORSAllowedOrigins, "An explicit list of origins that are allowed for CORS requests.").Array().HasDefault([]string{}), + docs.FieldString(fieldCORSAllowedOrigins, "An explicit list of origins that are allowed for CORS requests.").Array().HasDefault([]any{}), ).AtVersion("3.63.0").Advanced() } diff --git a/internal/template/config.go b/internal/template/config.go index 9f805507dd..309fbbab0c 100644 --- a/internal/template/config.go +++ b/internal/template/config.go @@ -257,7 +257,7 @@ func ConfigSpec() docs.FieldSpecs { ).HasDefault("stable"), docs.FieldString( "categories", "An optional list of tags, which are used for arbitrarily grouping components in documentation.", - ).Array().HasDefault([]string{}), + ).Array().HasDefault([]any{}), docs.FieldString("summary", "A short summary of the component.").HasDefault(""), docs.FieldString("description", "A longer form description of the component and how to use it.").HasDefault(""), docs.FieldObject("fields", "The configuration fields of the template, fields specified here will be parsed from a Benthos config and will be accessible from the template mapping.").Array().WithChildren(FieldConfigSpec()...), diff --git a/internal/tls/docs.go b/internal/tls/docs.go index c73237b246..b59f0e88e9 100644 --- a/internal/tls/docs.go +++ b/internal/tls/docs.go @@ -47,6 +47,6 @@ func FieldSpec() docs.FieldSpec { docs.FieldString("cert_file", "The path of a certificate to use.").HasDefault(""), docs.FieldString("key_file", "The path of a certificate key to use.").HasDefault(""), docs.FieldString("password", "A plain text password for when the private key is password encrypted in PKCS#1 or PKCS#8 format. The obsolete `pbeWithMD5AndDES-CBC` algorithm is not supported for the PKCS#8 format. Warning: Since it does not authenticate the ciphertext, it is vulnerable to padding oracle attacks that can let an attacker recover the plaintext.", "foo", "${KEY_PASSWORD}").HasDefault("").Secret(), - ).HasDefault([]string{}), + ).HasDefault([]any{}), ).Advanced() }