Skip to content

Commit

Permalink
remove uri|datauri validation of buffer and image
Browse files Browse the repository at this point in the history
  • Loading branch information
qmuntal committed Feb 21, 2019
1 parent 8769141 commit fa66d7e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions struct.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ type Buffer struct {
Extensions interface{} `json:"extensions,omitempty"`
Extras map[string]interface{} `json:"extras,omitempty"`
Name string `json:"name,omitempty"`
URI string `json:"uri,omitempty" validate:"omitempty,uri|datauri"`
URI string `json:"uri,omitempty" validate:"omitempty"`
ByteLength uint32 `json:"byteLength" validate:"required"`
Data []uint8 `json:"-"`
}
Expand Down Expand Up @@ -702,7 +702,7 @@ type Image struct {
Extensions interface{} `json:"extensions,omitempty"`
Extras map[string]interface{} `json:"extras,omitempty"`
Name string `json:"name,omitempty"`
URI string `json:"uri,omitempty" validate:"omitempty,uri|datauri"`
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.
}
Expand Down
4 changes: 2 additions & 2 deletions validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestValidateDocument(t *testing.T) {
Accessors: []Accessor{{ComponentType: Byte, Count: 1, Type: "SCALAR",
Sparse: &Sparse{Count: 1, Indices: SparseIndices{ComponentType: 1}}}}}, true},
{"Document.Buffers[0].URI", &Document{Asset: Asset{Version: "1.0"},
Buffers: []Buffer{{ByteLength: 1, URI: "http://[web].com"}}}, true},
Buffers: []Buffer{{ByteLength: 1, URI: "a.bin"}}}, false},
{"Document.Buffers[0].ByteLength", &Document{Asset: Asset{Version: "1.0"},
Buffers: []Buffer{{ByteLength: 0, URI: "http://web.com"}}}, true},
{"Document.BufferViews[0].ByteLength", &Document{Asset: Asset{Version: "1.0"},
Expand Down Expand Up @@ -96,7 +96,7 @@ func TestValidateDocument(t *testing.T) {
{"Document.Samplers[0].WrapT", &Document{Asset: Asset{Version: "1.0"},
Samplers: []Sampler{{MagFilter: MagLinear, MinFilter: MinLinear, WrapS: ClampToEdge, WrapT: 1}}}, true},
{"Document.Images[0].URI", &Document{Asset: Asset{Version: "1.0"},
Images: []Image{{URI: "http://[web].com"}}}, true},
Images: []Image{{URI: "a.png"}}}, false},
{"Document.Images[0].MimeType", &Document{Asset: Asset{Version: "1.0"},
Images: []Image{{BufferView: 1}}}, true},
{"Document.Animations[0].Channels", &Document{Asset: Asset{Version: "1.0"},
Expand Down

0 comments on commit fa66d7e

Please sign in to comment.