-
Notifications
You must be signed in to change notification settings - Fork 957
Open
Open
Copy link
Labels
s2Broken use cases or features (with a workaround). Only humans may set this.Broken use cases or features (with a workaround). Only humans may set this.
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
Go empty values are invalidly serialized as null instead of empty values. Consider the following snippet:
$ echo '{"field": "groups"}' | coder organization settings set org-sync
{
"field": "groups",
"mapping": null,
"organization_assign_default": false
}
And in the UI we get "Can't convert null to object"
We can see that if we don't explicitly set the mapping field, it ends up being null instead of {}. This breaks the JavaScript client side.
Workaround:
A workaround right now is to explicitly set mapping to an empty value:
echo '{"field": "groups", "mapping": {}}' | coder organization settings set org-sync
The real solution is to convert empty Go maps to empty JSON objects instead of null.
The IdP sync settings for an organization have the same problem.
Additional Context: May have a similar cause as #16988
Relevant Log Output
Expected Behavior
Missing entities, either null or {} should not cause fatal errors or should be automatically mapped to {} instead
Steps to Reproduce
- Create an 'null' group by using the org-sync function (https://coder.com/docs/reference/cli/organizations_settings_show_organization-sync)
- echo '{"field": "groups"}' | coder organization settings set org-sync
Environment
- Host OS:
- Coder version:
Additional Context
No response
Metadata
Metadata
Assignees
Labels
s2Broken use cases or features (with a workaround). Only humans may set this.Broken use cases or features (with a workaround). Only humans may set this.