In python, it calls:
(Pdb) json
{'columns': [{'id': 'MANUFACTURING', 'fields': {'colRef': 96, 'parentId': 9, 'parentPos': 96, 'type': 'ChoiceList', 'widgetOptions': '{"widget": "TextBox", "alignment": "left", "headerFillColor": "#0057b8", "headerTextColor": "#FFFFFF", "choices": ["True", "False"], "choiceOptions": {}}', 'isFormula': False, 'formula': '', 'label': 'MANUFACTURING', 'description': '', 'untieColIdFromLabel': False, 'summarySourceCol': 0, 'displayCol': 0, 'visibleCol': 0, 'rules': None, 'reverseCol': 0, 'recalcWhen': 0, 'recalcDeps': None}}]}
resp = request(method, url, headers=headers, params=params, json=json, **self.request_options)
this returns 400. it is a single string, json inside, e.g.:
'widgetOptions': '{"widget": "TextBox", "alignment": "left", "headerFillColor": "#0057b8", "headerTextColor": "#FFFFFF", "choices": ["True", "False"], "choiceOptions": {}}'
(Pdb) json['columns'][0]['fields']['widgetOptions']
'{"widget": "TextBox", "alignment": "left", "headerFillColor": "#0057b8", "headerTextColor": "#FFFFFF", "choices": ["True", "False"], "choiceOptions": {}}'
If i convert it manually back to json, still a 400.
If i manually modify it to one entry in the string:
(Pdb) json
{'columns': [{'id': 'MANUFACTURING', 'fields': {'colRef': 96, 'parentId': 9, 'parentPos': 96, 'type': 'ChoiceList', 'widgetOptions': '{"headerFillColor": "#0057b8" }', 'isFormula': False, 'formula': '', 'label': 'MANUFACTURING', 'description': '', 'untieColIdFromLabel': False, 'summarySourceCol': 0, 'displayCol': 0, 'visibleCol': 0, 'rules': None, 'reverseCol': 0, 'recalcWhen': 0, 'recalcDeps': None}}]}
(Pdb) resp = request(method, url, headers=headers, params=params, json=json, **self.request_options)
(Pdb) resp
<Response [400]>
its still 400
If i use the requests Prepare method of tracing:
PATCH https://grist.agilicus.ca/api/docs/TABLEID/tables/Domain_insight_summary/columns
Content-Type: application/json
Accept: application/json
Authorization: Bearer AUTHENTICATIONINFOREDACTED
Content-Length: 410
b'{"columns": [{"id": "MANUFACTURING", "fields": {"colRef": 96, "parentId": 9, "parentPos": 96, "type": "ChoiceList", "widgetOptions": "{\\"headerFillColor\\": \\"#0057b8\\" }", "isFormula": false, "formula": "", "label": "MANUFACTURING", "description": "", "untieColIdFromLabel": false, "summarySourceCol": 0, "displayCol": 0, "visibleCol": 0, "rules": null, "reverseCol": 0, "recalcWhen": 0, "recalcDeps": null}}]}'