MarshalJSON encodes as a JSON string: " : ".
()
| 37 | |
| 38 | // MarshalJSON encodes as a JSON string: "<type>:<id>". |
| 39 | func (t APIAllowListTarget) MarshalJSON() ([]byte, error) { |
| 40 | return json.Marshal(t.String()) |
| 41 | } |
| 42 | |
| 43 | // UnmarshalJSON decodes from a JSON string: "<type>:<id>". |
| 44 | func (t *APIAllowListTarget) UnmarshalJSON(b []byte) error { |