Skip to content

sturfeeinc/glTF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoDoc

glTF

Struct for marshaling and unmarshaling glTF

go get github.com/sturfeeinc/glTF/model

It's autogenerated code from official work group's specs. Don't edit it. Edit the generator

Libraries

Validation

There are not auto validation. You can use validator.v9 explicitly before json.Marshal.

package main

import (
	"encoding/json"
	"github.com/sturfeeinc/glTF/model"
	"gopkg.in/go-playground/validator.v9"
)

func main() {

	validate := validator.New()

	gltf := glTF{}

	// ...

	err := validate.Struct(gltf)
	if err != nil {
		// handling
	}
	res, err := json.Marshal(gltf)
	println(res)
}

I thought about realization of strict validation in MarshalJSON and UnmarshalJSON for every struct. But for now it will to much complex.

Authors

About

Struct for marshaling and unmarshaling glTF

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages