I guess you want to treat this as if the JSON String were just part of the surrounding JSON object? If so, then yes, as you suggest, a custom UnmarshalJSON
method on Child
should accomplish this.
func (c *Child) UnmarshalJSON(p []byte) error { var jsonString string if err := json.Unmarshal(p, &jsonString); err != nil { return err // Means the string was invalid } type C Child // A new type that doesn't have UnmarshalJSON method return json.Unmarshal([]byte(jsonString), (*C)(c))}