Skip to content

Commit

Permalink
Add trim filter and add empty schema check
Browse files Browse the repository at this point in the history
Signed-off-by: Ashish Tiwari <[email protected]>
  • Loading branch information
Revolyssup committed Mar 10, 2023
1 parent 5668222 commit a6caf03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions models/meshmodel/core/v1alpha1/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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)
Expand Down

0 comments on commit a6caf03

Please sign in to comment.