From a6caf0375e9d7d67d3e5331cafb6c5f6cc9ae735 Mon Sep 17 00:00:00 2001 From: Ashish Tiwari Date: Sat, 11 Mar 2023 00:24:18 +0530 Subject: [PATCH] Add trim filter and add empty schema check Signed-off-by: Ashish Tiwari --- models/meshmodel/core/v1alpha1/component.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/meshmodel/core/v1alpha1/component.go b/models/meshmodel/core/v1alpha1/component.go index 6f4645bd..8ea6bdad 100644 --- a/models/meshmodel/core/v1alpha1/component.go +++ b/models/meshmodel/core/v1alpha1/component.go @@ -55,7 +55,7 @@ func (c ComponentDefinition) Type() types.CapabilityType { func (c ComponentDefinition) GetID() uuid.UUID { return c.ID } -func schemaValidationCheck(schema string) (valid bool) { +func emptySchemaCheck(schema string) (valid bool) { if schema == "" { return } @@ -75,7 +75,7 @@ func CreateComponent(db *database.Handler, c ComponentDefinition) (uuid.UUID, er if err != nil { return uuid.UUID{}, err } - if !schemaValidationCheck(c.Schema) { + if !emptySchemaCheck(c.Schema) { c.Metadata["hasInvalidSchema"] = true } modelID := uuid.NewSHA1(uuid.UUID{}, byt)