From 6bd7ad0fb2d45f7f36de9bdc9865f1191d8f8119 Mon Sep 17 00:00:00 2001 From: Shreyas Goenka Date: Wed, 4 Sep 2024 11:15:00 +0200 Subject: [PATCH] clarify interface comments --- libs/jsonschema/from_type.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libs/jsonschema/from_type.go b/libs/jsonschema/from_type.go index 21fdb2106..95914d4fd 100644 --- a/libs/jsonschema/from_type.go +++ b/libs/jsonschema/from_type.go @@ -182,10 +182,9 @@ func (c *constructor) walk(typ reflect.Type) error { case reflect.Float32, reflect.Float64: s = Schema{Type: NumberType} case reflect.Interface: - // Interface or any types are not serialized to JSON by the default JSON - // unmarshaller (json.Unmarshal). They likely thus are parsed by the - // dynamic configuration tree and we should support arbitary values here. - // Eg: variables.default can be anything. + // We cannot determine the schema for fields of interface type just based + // on the type information. Thus we'll set the empty schema here and allow + // arbitrary values. s = Schema{} default: return fmt.Errorf("unsupported type: %s", typ.Kind())