From 4cbba4a8decef798523fcd4f5198cd76cb96d0cc Mon Sep 17 00:00:00 2001 From: Matej Vasek Date: Wed, 13 Sep 2023 20:59:21 +0200 Subject: [PATCH] chore: better JSON Schema (#1968) Signed-off-by: Matej Vasek --- pkg/functions/function.go | 2 +- schema/func_yaml-schema.json | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/functions/function.go b/pkg/functions/function.go index d7a09a73..6804f62c 100644 --- a/pkg/functions/function.go +++ b/pkg/functions/function.go @@ -77,7 +77,7 @@ type Function struct { // Invoke defines hints for use when invoking this function. // See Client.Invoke for usage. - Invoke string `yaml:"invoke,omitempty"` + Invoke string `yaml:"invoke,omitempty" jsonschema:"enum=http,enum=cloudevent"` // Build defines the build properties for a function Build BuildSpec `yaml:"build,omitempty"` diff --git a/schema/func_yaml-schema.json b/schema/func_yaml-schema.json index 8d9924a1..ab5c425c 100644 --- a/schema/func_yaml-schema.json +++ b/schema/func_yaml-schema.json @@ -164,6 +164,10 @@ "format": "date-time" }, "invoke": { + "enum": [ + "http", + "cloudevent" + ], "type": "string", "description": "Invoke defines hints for use when invoking this function.\nSee Client.Invoke for usage." },