## TL;DR

For "400 Invalid Resource: options.choices - Schema describes array, object found instead": upgrade drewm/mailchimp-api past the January 2016 fix.

```text
400 Invalid Resource: options.choices - Schema describes array, object found instead
```

## Steps

1. PATCHing a merge field (e.g. `lists/{id}/merge-fields/{merge_id}` with
`options.choices`) via drewm/mailchimp-api failed with:

```
400 Invalid Resource: options.choices - Schema describes array, object found instead
```

2. The payload showed `{"options":{"choices":{"0":"Aaa","1":"Bbb"}}}`: the array
of choices had been encoded as a JSON object with numeric keys.

3. The maintainer merged a community PR fixing the encoding so non-associative
arrays serialize as JSON arrays. Upgrade drewm/mailchimp-api past the January
2016 fix.

## When to use

You are seeing this: The wrapper passed JSON\_FORCE\_OBJECT to json\_encode, which turns every PHP array into a JSON object, breaking every API field that expects a real array. Use this skill when you run into "MailChimp API PATCH: "Schema describes array, object found" (JSON_FORCE_OBJECT)".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

The wrapper passed JSON\_FORCE\_OBJECT to json\_encode, which turns every PHP array into a JSON object, breaking every API field that expects a real array.
