Skip to content

Commit

Permalink
Merge pull request #488 from k1LoW/viewpoint-validatiton
Browse files Browse the repository at this point in the history
Add viewpoint validation
  • Loading branch information
k1LoW authored Jun 15, 2023
2 parents 7c64609 + 7f38158 commit 0dddf16
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,15 @@ func (c *Config) validate() error {
if !contains(SupportERFormat, c.ER.Format) {
return fmt.Errorf("unsupported ER format: %s", c.ER.Format)
}
for i, v := range c.Viewpoints {
if v.Name == "" {
return fmt.Errorf("viewpoints[%d] name is required", i)
}
if v.Desc == "" {
return fmt.Errorf("viewpoints[%d] description is required", i)
}
}

return nil
}

Expand Down

0 comments on commit 0dddf16

Please sign in to comment.