Title: bug: template settings and inconsistent API behavior ("empty field" vs "delete request") · Issue #5066 · coder/coder · GitHub
Open Graph Title: bug: template settings and inconsistent API behavior ("empty field" vs "delete request") · Issue #5066 · coder/coder
X Title: bug: template settings and inconsistent API behavior ("empty field" vs "delete request") · Issue #5066 · coder/coder
Description: Spotted in: #5060 (comment) When a user wants to clear the field content (e.g. description) using the Template Settings form, and submit description: "", it isn't possible as the API considers it as "no change". On the other hand, a user...
Open Graph Description: Spotted in: #5060 (comment) When a user wants to clear the field content (e.g. description) using the Template Settings form, and submit description: "", it isn't possible as the API considers it a...
X Description: Spotted in: #5060 (comment) When a user wants to clear the field content (e.g. description) using the Template Settings form, and submit description: "", it isn't possible as the API ...
Opengraph URL: https://github.com/coder/coder/issues/5066
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bug: template settings and inconsistent API behavior (\"empty field\" vs \"delete request\")","articleBody":"Spotted in: https://github.com/coder/coder/pull/5060#discussion_r1021361289\r\n\r\nWhen a user wants to clear the field content (e.g. description) using the Template Settings form, and submit `description: \"\"`, it isn't possible as the API considers it as \"no change\". On the other hand, a user can set the icon field, but calling the CLI: `coder templates edit \u003ctemplate-name>` will simply remove the icon.\r\n\r\nThe suggested solution would be to distinguish these actions:\r\n- delete the field: field `\"\"` is present in the JSON request\r\n- leave as is: field is not present in the request\r\n- modify the field: non-empty field is present in the request \r\n\r\nIt implicates that [CreateTemplateRequest](https://github.com/coder/coder/blob/main/codersdk/organizations.go#L50) and [UpdateTemplateMeta](https://github.com/coder/coder/blob/main/codersdk/templates.go#L74) should either contain nillable fields or we need to redesign that contract (API can receive a set of modify-actions).\r\n\r\nLet me know your thoughts!","author":{"url":"https://github.com/mtojek","@type":"Person","name":"mtojek"},"datePublished":"2022-11-14T14:31:29Z","url":"https://github.com/coder/coder/issues/5066"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5d0964df-2192-14b6-75af-33193a612334 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BFA4:2E7EBB:2D0F1DB:39038A1:6B01AE2B |
| html-safe-nonce | f4137e7d1bbf5a5a8826bcce47e552a9ebb00debb34dc199ff2af12bd25302fe |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRkE0OjJFN0VCQjoyRDBGMURCOjM5MDM4QTE6NkIwMUFFMkIiLCJ2aXNpdG9yX2lkIjoiMzgxMTE0NDU2NjI1MDI1Mzg2NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b098509d839463678a4e1a0c6702c9829891ffcaf700892a05c9d9810e2f161e |
| hovercard-subject-tag | issue:1448179474 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/coder/5066/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5ec26eb617aedeb2d31498c7144de6767e5907ca381b2ee7148be19f3067992c/coder/coder/issues/5066 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5ec26eb617aedeb2d31498c7144de6767e5907ca381b2ee7148be19f3067992c/coder/coder/issues/5066 |
| og:image:alt | Spotted in: #5060 (comment) When a user wants to clear the field content (e.g. description) using the Template Settings form, and submit description: "", it isn't possible as the API considers it a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mtojek |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/coder/coder git https://github.com/coder/coder.git |
| octolytics-dimension-user_id | 95932066 |
| octolytics-dimension-user_login | coder |
| octolytics-dimension-repository_id | 440752086 |
| octolytics-dimension-repository_nwo | coder/coder |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 440752086 |
| octolytics-dimension-repository_network_root_nwo | coder/coder |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width