// UnmarshalJSON unmarshals the type property.
UnmarshalJSON unmarshals the type property.
// UnmarshalJSON unmarshals the type property .
func (p *TypeProperty) UnmarshalJSON(bytes []byte) error {
	var ctx Type
	err := json.Unmarshal(bytes, &ctx)
	if err == nil {
		p.types = []Type{ctx}
		return nil
	}
	var types []Type
	err = json.Unmarshal(bytes, &types)
	if err != nil {
		return err
	}
	p.types = types
	return nil
}
func ( p * TypeProperty ) UnmarshalJSON ( bytes [ ] byte ) error { var ctx Type err := json . Unmarshal ( bytes , & ctx ) if err == nil { p . types = [ ] Type { ctx } return nil } var types [ ] Type err = json . Unmarshal ( bytes , & types ) if err != nil { return err } p . types = types return nil }
UnmarshalJSON unmarshals the type property.
UnmarshalJSON unmarshals the type property .