nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: qmuntal/gltf
Pull request #12 (2019-05-03 14:14:44)

Image.BufferView is now a uint32 pointer
Image.BufferView is nullable if using Image.URI instead


Patch:
diff --git a/struct.go b/struct.go
index 518b855..970e40f 100644
--- a/struct.go
+++ b/struct.go
@@ -613,7 +613,7 @@ type Image struct {
 	Name       string      `json:"name,omitempty"`
 	URI        string      `json:"uri,omitempty" validate:"omitempty"`
 	MimeType   string      `json:"mimeType,omitempty" validate:"omitempty,oneof=image/jpeg image/png"` // Manadatory if BufferView is defined.
-	BufferView uint32      `json:"bufferView,omitempty"`                                               // Use this instead of the image's uri property.
+	BufferView *uint32      `json:"bufferView,omitempty"`                                               // Use this instead of the image's uri property.
 }
 
 // IsEmbeddedResource returns true if the buffer points to an embedded resource.


Test patch:
diff --git a/encode_test.go b/encode_test.go
index 3fce7ce..0ae54cc 100644
--- a/encode_test.go
+++ b/encode_test.go
@@ -86,7 +86,7 @@ func TestEncoder_Encode(t *testing.T) {
 			{Extras: 8.0, Name: "cam_2", Perspective: &Perspective{Extras: 8.0, AspectRatio: Float64(1), Yfov: 2, Zfar: Float64(3), Znear: 4}},
 		}}}, false},
 		{"withImages", args{&Document{Images: []Image{
-			{Extras: 8.0, Name: "binary", BufferView: 1, MimeType: "data:image/png"},
+			{Extras: 8.0, Name: "binary", BufferView: Index(1), MimeType: "data:image/png"},
 			{Extras: 8.0, Name: "embedded", URI: "data:image/png;base64,dsjdsaGGUDXGA", MimeType: "data:image/png"},
 			{Extras: 8.0, Name: "external", URI: "https://web.com/a", MimeType: "data:image/png"},
 		}}}, false},
diff --git a/validator_test.go b/validator_test.go
index a8ad5a9..a324088 100644
--- a/validator_test.go
+++ b/validator_test.go
@@ -96,7 +96,7 @@ func TestValidateDocument(t *testing.T) {
 		{"Document.Images[0].URI", &Document{Asset: Asset{Version: "1.0"},
 			Images: []Image{{URI: "a.png"}}}, false},
 		{"Document.Images[0].MimeType", &Document{Asset: Asset{Version: "1.0"},
-			Images: []Image{{BufferView: 1}}}, true},
+			Images: []Image{{BufferView: Index(1)}}}, true},
 		{"Document.Animations[0].Channels", &Document{Asset: Asset{Version: "1.0"},
 			Animations: []Animation{{Samplers: []AnimationSampler{{}}}}}, true},
 		{"Document.Animations[0].Channels[0].Target.Path", &Document{Asset: Asset{Version: "1.0"},