Check declared schema locations for external resources

This commit is contained in:
2026-11-05 13:57:21 +00:00
parent e056cb1607
commit cddb2b389c
4 changed files with 164 additions and 1 deletions

View File

@@ -436,7 +436,14 @@ func compileSchemaDocument(ctx context.Context, resourceURL string, document any
}
return nil, fmt.Errorf("register schema: %w", err)
}
return compileJSONSchema(ctx, resourceURL, compiler.Compile)
root, err := compileJSONSchema(ctx, resourceURL, compiler.Compile)
if err != nil {
return nil, err
}
if err := checkSchemaLocations(ctx, compiler, resourceURL, document, "", root); err != nil {
return nil, err
}
return root, nil
}
type schemaExecutor interface {