-
Notifications
You must be signed in to change notification settings - Fork 956
Open
Description
Description:
The presets
endpoint has been available since v2.20 and currently returns JSON keys in CamelCase
, while other API responses use snake_case
.
To align with our convention without introducing a breaking change, we can return both formats for now and mark the CamelCase
keys as deprecated. This will give consumers time to migrate before fully switching to snake_case
in a future major version.
Current example response
[
{
"ID": "4caa3b16-8cd5-4c1f-ad8f-6687d7138f0c",
"Name": "Cape Town",
"Parameters": [
{
"Name": "Coder Repository Base Directory",
"Value": "~"
},
{
"Name": "Memory usage threshold",
"Value": "80"
},
{
"Name": "Region",
"Value": "za-cpt"
},
{
"Name": "Volume path",
"Value": "/home/coder"
},
{
"Name": "Volume usage threshold",
"Value": "90"
},
{
"Name": "Coder Image",
"Value": "codercom/oss-dogfood:latest"
}
],
"Default": false,
"DesiredPrebuildInstances": 1,
"Description": "Development workspace hosted in South Africa with 1 prebuild instance",
"Icon": "/emojis/1f1ff-1f1e6.png"
},
...
Proposed approach:
- Return both
CamelCase
andsnake_case
keys in API response for thepresets
endpoint. - Mark the
CamelCase
keys as deprecated in the API documentation and OpenAPI spec. - After a deprecation period, remove the
CamelCase
keys in a future major version.
Metadata
Metadata
Assignees
Labels
No labels