Problem
The save endpoint for metadata items is registered as PUT /api/v1/meta/:type/:name in packages/rest/src/rest-server.ts. This is correct REST semantics, but creates discoverability friction:
-
Only PUT is accepted. Many API clients and tools default to POST (Postman defaults, fetch with body, curl -d). Sending a POST to the correct path returns a generic 404 with no hint that PUT is the expected method.
-
No helpful error when :name is missing. A request like POST /api/v1/meta/view/?mode=draft (trailing slash, missing name segment) doesn't match /:type/:name and returns {"error":"Not found"}. Callers have no way to distinguish "route doesn't exist" from "URL is malformed."
Proposed solution
A. Register a POST alias in registerMetadataEndpoints() (at packages/rest/src/rest-server.ts ~line 2746) that delegates to the same handler as the PUT route. This is safe because:
- Sub-routes (
/publish, /rollback) are already registered as more-specific POST paths that match first
- The handler uses
?mode=draft query param (not HTTP method) to distinguish draft saves
B. Optionally register a descriptive error handler on /:type alone so that incomplete URLs return a useful message instead of a generic 404.
Expected outcome
# Before
$ curl -X POST http://localhost:8080/api/v1/meta/view/my_view?mode=draft -d '{}'
{"error":"Not found"}
# After
$ curl -X POST http://localhost:8080/api/v1/meta/view/my_view?mode=draft -d '{}'
{"name":"my_view", ...} # works via POST alias
Where
packages/rest/src/rest-server.ts — registerMetadataEndpoints(), PUT handler around line 2746
Problem
The save endpoint for metadata items is registered as
PUT /api/v1/meta/:type/:nameinpackages/rest/src/rest-server.ts. This is correct REST semantics, but creates discoverability friction:Only PUT is accepted. Many API clients and tools default to POST (Postman defaults,
fetchwith body,curl -d). Sending a POST to the correct path returns a generic 404 with no hint that PUT is the expected method.No helpful error when
:nameis missing. A request likePOST /api/v1/meta/view/?mode=draft(trailing slash, missing name segment) doesn't match/:type/:nameand returns{"error":"Not found"}. Callers have no way to distinguish "route doesn't exist" from "URL is malformed."Proposed solution
A. Register a POST alias in
registerMetadataEndpoints()(atpackages/rest/src/rest-server.ts~line 2746) that delegates to the same handler as the PUT route. This is safe because:/publish,/rollback) are already registered as more-specific POST paths that match first?mode=draftquery param (not HTTP method) to distinguish draft savesB. Optionally register a descriptive error handler on
/:typealone so that incomplete URLs return a useful message instead of a generic 404.Expected outcome
Where
packages/rest/src/rest-server.ts—registerMetadataEndpoints(), PUT handler around line 2746