func (u IPv6) MarshalJSON() ([]byte, error) {
	return json.Marshal(string(u))
}
MarshalJSON returns the IPv6 as JSON
package strfmt
import (
	"encoding/base64"
	"encoding/json"
	"fmt"
	"net/mail"
	"regexp"
	"strings"
	"github.com/asaskevich/govalidator"
	netutils "k8s.io/utils/net"
)
const (
	HostnamePattern = `^([a-zA-Z0-9\p{S}\p{L}]((-?[a-zA-Z0-9\p{S}\p{L}]{0,62})?)|([a-zA-Z0-9\p{S}\p{L}](([a-zA-Z0-9-\p{S}\p{L}]{0,61}[a-zA-Z0-9\p{S}\p{L}])?)(\.)){1,}([a-zA-Z\p{L}]){2,63})$`
	UUIDPattern = `(?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$`
	UUID3Pattern = `(?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?3[0-9a-f]{3}-?[0-9a-f]{4}-?[0-9a-f]{12}$`
	UUID4Pattern = `(?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?4[0-9a-f]{3}-?[89ab][0-9a-f]{3}-?[0-9a-f]{12}$`
	UUID5Pattern = `(?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?5[0-9a-f]{3}-?[89ab][0-9a-f]{3}-?[0-9a-f]{12}$`
	jsonNull = "null"
)
var (
	rxHostname = regexp.MustCompile(HostnamePattern)
	rxUUID     = regexp.MustCompile(UUIDPattern)
	rxUUID3    = regexp.MustCompile(UUID3Pattern)
	rxUUID4    = regexp.MustCompile(UUID4Pattern)
	rxUUID5    = regexp.MustCompile(UUID5Pattern)
)
func IsHostname(str string) bool {
	if !rxHostname.MatchString(str) {
		return false
	}
	if len(str) > 255 {
		return false
	}
	parts := strings.Split(str, ".")
	valid := true
	for _, p := range parts {
		if len(p) > 63 {
			valid = false
		}
	}
	return valid
}
func IsUUID(str string) bool {
	return rxUUID.MatchString(str)
}
func IsUUID3(str string) bool {
	return rxUUID3.MatchString(str)
}
func IsUUID4(str string) bool {
	return rxUUID4.MatchString(str)
}
func IsUUID5(str string) bool {
	return rxUUID5.MatchString(str)
}
func IsEmail(str string) bool {
	addr, e := mail.ParseAddress(str)
	return e == nil && addr.Address != ""
}
func init() {
	u := URI("")
	Default.Add("uri", &u, govalidator.IsRequestURI)
	eml := Email("")
	Default.Add("email", &eml, IsEmail)
	hn := Hostname("")
	Default.Add("hostname", &hn, IsHostname)
	ip4 := IPv4("")
	Default.Add("ipv4", &ip4, isIPv4)
	ip6 := IPv6("")
	Default.Add("ipv6", &ip6, govalidator.IsIPv6)
	cidr := CIDR("")
	Default.Add("cidr", &cidr, isCIDR)
	mac := MAC("")
	Default.Add("mac", &mac, govalidator.IsMAC)
	uid := UUID("")
	Default.Add("uuid", &uid, IsUUID)
	uid3 := UUID3("")
	Default.Add("uuid3", &uid3, IsUUID3)
	uid4 := UUID4("")
	Default.Add("uuid4", &uid4, IsUUID4)
	uid5 := UUID5("")
	Default.Add("uuid5", &uid5, IsUUID5)
	isbn := ISBN("")
	Default.Add("isbn", &isbn, func(str string) bool { return govalidator.IsISBN10(str) || govalidator.IsISBN13(str) })
	isbn10 := ISBN10("")
	Default.Add("isbn10", &isbn10, govalidator.IsISBN10)
	isbn13 := ISBN13("")
	Default.Add("isbn13", &isbn13, govalidator.IsISBN13)
	cc := CreditCard("")
	Default.Add("creditcard", &cc, govalidator.IsCreditCard)
	ssn := SSN("")
	Default.Add("ssn", &ssn, govalidator.IsSSN)
	hc := HexColor("")
	Default.Add("hexcolor", &hc, govalidator.IsHexcolor)
	rc := RGBColor("")
	Default.Add("rgbcolor", &rc, govalidator.IsRGBcolor)
	b64 := Base64([]byte(nil))
	Default.Add("byte", &b64, govalidator.IsBase64)
	pw := Password("")
	Default.Add("password", &pw, func(_ string) bool { return true })
}
func isIPv4(s string) bool {
	ip := netutils.ParseIPSloppy(s)
	return ip != nil && strings.Contains(s, ".")
}
func isCIDR(s string) bool {
	_, _, err := netutils.ParseCIDRSloppy(s)
	return err == nil
}
type Base64 []byte
func (b Base64) MarshalText() ([]byte, error) {
	enc := base64.URLEncoding
	src := []byte(b)
	buf := make([]byte, enc.EncodedLen(len(src)))
	enc.Encode(buf, src)
	return buf, nil
}
func (b *Base64) UnmarshalText(data []byte) error {  
	enc := base64.URLEncoding
	dbuf := make([]byte, enc.DecodedLen(len(data)))
	n, err := enc.Decode(dbuf, data)
	if err != nil {
		return err
	}
	*b = dbuf[:n]
	return nil
}
func (b *Base64) Scan(raw interface{}) error {
	switch v := raw.(type) {
	case []byte:
		dbuf := make([]byte, base64.StdEncoding.DecodedLen(len(v)))
		n, err := base64.StdEncoding.Decode(dbuf, v)
		if err != nil {
			return err
		}
		*b = dbuf[:n]
	case string:
		vv, err := base64.StdEncoding.DecodeString(v)
		if err != nil {
			return err
		}
		*b = Base64(vv)
	default:
		return fmt.Errorf("cannot sql.Scan() strfmt.Base64 from: %#v", v)
	}
	return nil
}
func (b Base64) String() string {
	return base64.StdEncoding.EncodeToString([]byte(b))
}
func (b Base64) MarshalJSON() ([]byte, error) {
	return json.Marshal(b.String())
}
func (b *Base64) UnmarshalJSON(data []byte) error {
	var b64str string
	if err := json.Unmarshal(data, &b64str); err != nil {
		return err
	}
	vb, err := base64.StdEncoding.DecodeString(b64str)
	if err != nil {
		return err
	}
	*b = Base64(vb)
	return nil
}
func (b *Base64) DeepCopyInto(out *Base64) {
	*out = *b
}
func (b *Base64) DeepCopy() *Base64 {
	if b == nil {
		return nil
	}
	out := new(Base64)
	b.DeepCopyInto(out)
	return out
}
type URI string
func (u URI) MarshalText() ([]byte, error) {
	return []byte(string(u)), nil
}
func (u *URI) UnmarshalText(data []byte) error {  
	*u = URI(string(data))
	return nil
}
func (u *URI) Scan(raw interface{}) error {
	switch v := raw.(type) {
	case []byte:
		*u = URI(string(v))
	case string:
		*u = URI(v)
	default:
		return fmt.Errorf("cannot sql.Scan() strfmt.URI from: %#v", v)
	}
	return nil
}
func (u URI) String() string {
	return string(u)
}
func (u URI) MarshalJSON() ([]byte, error) {
	return json.Marshal(string(u))
}
func (u *URI) UnmarshalJSON(data []byte) error {
	var uristr string
	if err := json.Unmarshal(data, &uristr); err != nil {
		return err
	}
	*u = URI(uristr)
	return nil
}
func (u *URI) DeepCopyInto(out *URI) {
	*out = *u
}
func (u *URI) DeepCopy() *URI {
	if u == nil {
		return nil
	}
	out := new(URI)
	u.DeepCopyInto(out)
	return out
}
type Email string
func (e Email) MarshalText() ([]byte, error) {
	return []byte(string(e)), nil
}
func (e *Email) UnmarshalText(data []byte) error {  
	*e = Email(string(data))
	return nil
}
func (e *Email) Scan(raw interface{}) error {
	switch v := raw.(type) {
	case []byte:
		*e = Email(string(v))
	case string:
		*e = Email(v)
	default:
		return fmt.Errorf("cannot sql.Scan() strfmt.Email from: %#v", v)
	}
	return nil
}
func (e Email) String() string {
	return string(e)
}
func (e Email) MarshalJSON() ([]byte, error) {
	return json.Marshal(string(e))
}
func (e *Email) UnmarshalJSON(data []byte) error {
	var estr string
	if err := json.Unmarshal(data, &estr); err != nil {
		return err
	}
	*e = Email(estr)
	return nil
}
func (e *Email) DeepCopyInto(out *Email) {
	*out = *e
}
func (e *Email) DeepCopy() *Email {
	if e == nil {
		return nil
	}
	out := new(Email)
	e.DeepCopyInto(out)
	return out
}
type Hostname string
func (h Hostname) MarshalText() ([]byte, error) {
	return []byte(string(h)), nil
}
func (h *Hostname) UnmarshalText(data []byte) error {  
	*h = Hostname(string(data))
	return nil
}
func (h *Hostname) Scan(raw interface{}) error {
	switch v := raw.(type) {
	case []byte:
		*h = Hostname(string(v))
	case string:
		*h = Hostname(v)
	default:
		return fmt.Errorf("cannot sql.Scan() strfmt.Hostname from: %#v", v)
	}
	return nil
}
func (h Hostname) String() string {
	return string(h)
}
func (h Hostname) MarshalJSON() ([]byte, error) {
	return json.Marshal(string(h))
}
func (h *Hostname) UnmarshalJSON(data []byte) error {
	var hstr string
	if err := json.Unmarshal(data, &hstr); err != nil {
		return err
	}
	*h = Hostname(hstr)
	return nil
}
func (h *Hostname) DeepCopyInto(out *Hostname) {
	*out = *h
}
func (h *Hostname) DeepCopy() *Hostname {
	if h == nil {
		return nil
	}
	out := new(Hostname)
	h.DeepCopyInto(out)
	return out
}
type IPv4 string
func (u IPv4) MarshalText() ([]byte, error) {
	return []byte(string(u)), nil
}
func (u *IPv4) UnmarshalText(data []byte) error {  
	*u = IPv4(string(data))
	return nil
}
func (u *IPv4) Scan(raw interface{}) error {
	switch v := raw.(type) {
	case []byte:
		*u = IPv4(string(v))
	case string:
		*u = IPv4(v)
	default:
		return fmt.Errorf("cannot sql.Scan() strfmt.IPv4 from: %#v", v)
	}
	return nil
}
func (u IPv4) String() string {
	return string(u)
}
func (u IPv4) MarshalJSON() ([]byte, error) {
	return json.Marshal(string(u))
}
func (u *IPv4) UnmarshalJSON(data []byte) error {
	var ustr string
	if err := json.Unmarshal(data, &ustr); err != nil {
		return err
	}
	*u = IPv4(ustr)
	return nil
}
func (u *IPv4) DeepCopyInto(out *IPv4) {
	*out = *u
}
func (u *IPv4) DeepCopy() *IPv4 {
	if u == nil {
		return nil
	}
	out := new(IPv4)
	u.DeepCopyInto(out)
	return out
}
type IPv6 string
func (u IPv6) MarshalText() ([]byte, error) {
	return []byte(string(u)), nil
}
func (u *IPv6) UnmarshalText(data []byte) error {  
	*u = IPv6(string(data))
	return nil
}
func (u *IPv6) Scan(raw interface{}) error {
	switch v := raw.(type) {
	case []byte:
		*u = IPv6(string(v))
	case string:
		*u = IPv6(v)
	default:
		return fmt.Errorf("cannot sql.Scan() strfmt.IPv6 from: %#v", v)
	}
	return nil
}
func (u IPv6) String() string {
	return string(u)
}