Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ func (d *Schema) parseSchema(documentNode interface{}, currentSchema *subSchema)
} else {
return errors.New(formatErrorDescription(
Locale.MustBeOfAn(),
ErrorDetails{"x": KEY_ANY_OF, "y": TYPE_ARRAY},
ErrorDetails{"x": KEY_ALL_OF, "y": TYPE_ARRAY},
))
}
}
Expand Down
9 changes: 9 additions & 0 deletions schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,3 +380,12 @@ func TestIncorrectRef(t *testing.T) {
assert.Nil(t, s)
assert.Equal(t, "Object has no key 'fail'", err.Error())
}

func TestAllOfIncorrectTypeErrorMessage(t *testing.T) {
schemaLoader := NewStringLoader(`{"allOf": {}}`)

s, err := NewSchema(schemaLoader)

assert.Nil(t, s)
assert.EqualError(t, err, "allOf must be of an array")
}