Skip to content

Commit

Permalink
Allow ContentFieldsAPIResponse.Data to hold nested objects
Browse files Browse the repository at this point in the history
By using a generic `interface{}` instead of a `string` ContentFieldsAPIResponse
type can be used to unmarshall ContentFields with nested objects, not
just strings.

For example, this kind of response would throw an error before:
```json
{
  "data": [
    {
      "name": "some name",
      "complex-object": {
         "content": "content"
      }
    }
  ]
}
```
  • Loading branch information
failedguidedog committed May 7, 2021
1 parent 57efe38 commit ee62850
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,5 @@ type FeedAPIResponse struct {

// Content Fields
type ContentFieldsAPIResponse struct {
Data map[string]string `json:"data"`
Data map[string]interface{} `json:"data"`
}

0 comments on commit ee62850

Please sign in to comment.