···
schemaID := strings.ReplaceAll(relPath, string(filepath.Separator), ".")
t.Run(schemaID, func(t *testing.T) {
if _, resolveErr := catalog.Resolve(schemaID); resolveErr != nil {
t.Errorf("Failed to resolve schema %s: %v", schemaID, resolveErr)
···
name: "Valid post record",
-
recordType: "social.coves.post.record",
recordData: map[string]interface{}{
-
"$type": "social.coves.post.record",
"community": "did:plc:programming123",
"author": "did:plc:testauthor123",
···
name: "Invalid post record - missing required field",
-
recordType: "social.coves.post.record",
recordData: map[string]interface{}{
-
"$type": "social.coves.post.record",
"community": "did:plc:programming123",
// Missing required "author" field
···
schemaID := strings.ReplaceAll(relPath, string(filepath.Separator), ".")
t.Run(schemaID, func(t *testing.T) {
+
// Skip validation for definition-only files (*.defs) - they don't need a "main" section
+
// These files only contain shared type definitions referenced by other schemas
+
if strings.HasSuffix(schemaID, ".defs") {
+
t.Skip("Skipping defs-only file (no main section required)")
if _, resolveErr := catalog.Resolve(schemaID); resolveErr != nil {
t.Errorf("Failed to resolve schema %s: %v", schemaID, resolveErr)
···
name: "Valid post record",
+
recordType: "social.coves.community.post",
recordData: map[string]interface{}{
+
"$type": "social.coves.community.post",
"community": "did:plc:programming123",
"author": "did:plc:testauthor123",
···
name: "Invalid post record - missing required field",
+
recordType: "social.coves.community.post",
recordData: map[string]interface{}{
+
"$type": "social.coves.community.post",
"community": "did:plc:programming123",
// Missing required "author" field