@sanity/schema 5.6.0-next.37 → 5.6.0-next.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/_internal.js CHANGED
@@ -1499,7 +1499,7 @@ function validateAnnotations(annotations, visitorContext, problems) {
1499
1499
  _problems: [error(`Annotation must be an object, got ${getTypeOf(annotation)}`)]
1500
1500
  };
1501
1501
  const { _problems } = visitorContext.visit(annotation, visitorContext), targetType = annotation.type && visitorContext.getType(annotation.type);
1502
- return targetType && !isJSONTypeOf(targetType, "object", visitorContext) && _problems.push(
1502
+ return targetType && ("jsonType" in targetType || "type" in targetType) && !isJSONTypeOf(targetType, "object", visitorContext) && _problems.push(
1503
1503
  error(
1504
1504
  `Annotation cannot have type "${annotation.type}" - annotation types must inherit from object`
1505
1505
  )