code: func (p *Type) Validate() error {
  	if p.BaseType != nil {
  		p.Variant = TypeVariantBaseType
  	} else if p.StructTypeDef != nil {
  		p.Variant = TypeVariantStructTypeDef
  	} else if p.MapTypeDef != nil {
  		p.Variant = TypeVariantMapTypeDef
  	} else if p.ArrayTypeDef != nil {
  		p.Variant = TypeVariantArrayTypeDef
  	} else if p.EnumTypeDef != nil {
  		p.Variant = TypeVariantEnumTypeDef
  	} else if p.UnionTypeDef != nil {
  		p.Variant = TypeVariantUnionTypeDef
  	} else if p.StringTypeDef != nil {
  		p.Variant = TypeVariantStringTypeDef
  	} else if p.BytesTypeDef != nil {
  		p.Variant = TypeVariantBytesTypeDef
  	} else if p.NumberTypeDef != nil {
  		p.Variant = TypeVariantNumberTypeDef
  	} else if p.AliasTypeDef != nil {
  		p.Variant = TypeVariantAliasTypeDef
  	} else {
  		return fmt.Errorf("Type: Missing required variant")
  	}
  	return nil
  }
docs: //
  // Validate for Type
  //