Skip to content

Commit

Permalink
feat(API) updated validateJsonSchema expected error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Barbozafab committed Jan 24, 2024
1 parent ea3d866 commit aac207f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions API/models/validateEntity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,27 @@ func TestValidateJsonSchema(t *testing.T) {
func TestErrorValidateJsonSchema(t *testing.T) {
// Test test_data/KO json files
expectedErrors := map[string][]string{
"site1": {"missing properties: 'domain'", "/attributes/reservedColor does not match pattern"},
"site1": {"missing properties: 'domain'", "/attributes/reservedColor should be"},
"building1": {"missing properties: 'posXYUnit'", "/attributes/height expected string, but got number"},
"room1": {"additionalProperties 'banana' not allowed", "/attributes/axisOrientation value must be one of"},
"rack1": {"/attributes/posXYZ does not match pattern", "/attributes/heightUnit value must be one of"},
"rack1": {"/attributes/posXYZ should be", "/attributes/heightUnit value must be one of"},
"device1": {"missing properties: 'template'", "/description expected array, but got string"},
"group1": {"/attributes missing properties: 'content'", "/name does not match pattern"},
"group1": {"/attributes missing properties: 'content'", "/name should be"},
"obj_template5": {
"/slug does not match pattern",
"/slug should be",
"/attributes/vendor expected string, but got number",
"/slots/0/elemOrient value must be one of ",
"/slots/1/elemPos maximum 3 items required, but found 4 items",
"/slots/1/elemSize minimum 3 items required, but found 2 items",
"/slots/1/elemOrient value must be one of",
"/slots/2 missing properties: 'elemOrient'",
"/slots/2/labelPos value must be one of ",
"/slots/3/color does not match pattern",
"/slots/3/color should be",
},
"obj_template4": {
"/components/0/elemPos minimum 3 items required, but found 0 items",
`/components/1/elemOrient value must be one of "horizontal", "vertical", ""`,
"/components/1/color does not match pattern",
"/components/1/color should be",
"/components/3/labelPos value must be one of",
"/slots/0/elemOrient value must be one of",
},
Expand Down

0 comments on commit aac207f

Please sign in to comment.