code: func (c *CredentialValue) MarshalJSON() ([]byte, error) {
  	impl := credentialImpl{Version: 1}
  
  	switch c.cvtype {
  	case stringCV:
  		impl.Body.Type = "string"
  	case intCV:
  		impl.Body.Type = "number"
  	case floatCV:
  		impl.Body.Type = "number"
  	case unsetCV:
  		impl.Body.Type = "undefined"
  	case undecryptedCV:
  		impl.Body.Type = "undecrypted"
  	}
  
  	if c.cvtype != unsetCV && c.cvtype != undecryptedCV {
  		v, err := json.Marshal(c.raw)
  		if err != nil {
  			return nil, err
  		}
  
  		impl.Body.Value = v
  	} else {
  		impl.Body.Value = []byte(`""`)
  	}
  
  	b, err := json.Marshal(&impl)
  	if err != nil {
  		return nil, err
  	}
  
  	return []byte(strconv.Quote(string(b))), nil
  }
docs: // MarshalJSON implements the json.Marshaler interface.