diff --git a/schema.go b/schema.go index 9e93cd79..82faba7b 100644 --- a/schema.go +++ b/schema.go @@ -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}, )) } } diff --git a/schema_test.go b/schema_test.go index c05ddf08..6d35dd73 100644 --- a/schema_test.go +++ b/schema_test.go @@ -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") +}