signature/policy_config.go
func (p *Policy) UnmarshalJSON(data []byte) error {
	*p = Policy{}
	transports := policyTransportsMap{}
	if err := paranoidUnmarshalJSONObject(data, func(key string) interface{} {
		switch key {
		case "default":
			return &p.Default
		case "transports":
			return &transports
		default:
			return nil
		}
	}); err != nil {
		return err
	}

	if p.Default == nil {
		return InvalidPolicyFormatError("Default policy is missing")
	}
	p.Transports = map[string]PolicyTransportScopes(transports)
	return nil
}
func (p *Policy) UnmarshalJSON(data []byte) error {
	*p = Policy{}
	transports := policyTransportsMap{}
	if err := paranoidUnmarshalJSONObject(data, func(key string) interface{} {
		switch key {
		case "default":
			return &p.Default
		case "transports":
			return &transports
		default:
			return nil
		}
	}); err != nil {
		return err
	}

	if p.Default == nil {
		return InvalidPolicyFormatError("Default policy is missing")
	}
	p.Transports = map[string]PolicyTransportScopes(transports)
	return nil
}
func ( p * Policy ) UnmarshalJSON ( data [ ] byte ) error { * p = Policy { } transports := policyTransportsMap { } if err := paranoidUnmarshalJSONObject ( data , func ( key string ) interface { } { switch key { case " " : return & p . Default case " " : return & transports default : return nil } } ) ; err != nil { return err } if p . Default == nil { return InvalidPolicyFormatError ( " " ) } p . Transports = map [ string ] PolicyTransportScopes ( transports ) return nil }
// UnmarshalJSON implements the json.Unmarshaler interface.
UnmarshalJSON implements the json . Unmarshaler interface .