Summary
A non-GET request to an API path the adapter doesn't route falls through to the static View handler. That handler answers 405 "Static assets are GET-only." The message sends the caller (usually an agent writing frontend code) looking in the wrong place.
Seen in practice: the agent wired a frontend button to POST /api/_a2app/operate, which doesn't exist, and got:
Static assets are GET-only.
The real endpoint is POST /api/ops/<operation-name>. The error neither says the route doesn't exist nor points to it.
Where
adapters/adapter-core/src/static.ts:199-205: any method other than GET/HEAD returns method_not_allowed before the path is checked.
- The same behaviour exists in
toolkits/blueprint-go-react/template/main.go:385 and toolkits/blueprint-rust-react/template/src/main.rs:607.
Suggested fix
- Unmatched requests under
/api/ (and especially /api/_a2app/) should return 404 unknown_route from the adapter instead of reaching the static handler. For POSTs, include a hint such as: Operations are invoked with POST /api/ops/<name>; see /api/_a2app/describe for the list.
- The static handler should return 405 only for paths that actually resolve to a static file. Otherwise it should 404.
- Add adapter-core and blueprint tests:
POST /api/_a2app/does-not-exist → 404 with the hint; POST /index.html → 405.
Summary
A non-GET request to an API path the adapter doesn't route falls through to the static View handler. That handler answers 405 "Static assets are GET-only." The message sends the caller (usually an agent writing frontend code) looking in the wrong place.
Seen in practice: the agent wired a frontend button to
POST /api/_a2app/operate, which doesn't exist, and got:The real endpoint is
POST /api/ops/<operation-name>. The error neither says the route doesn't exist nor points to it.Where
adapters/adapter-core/src/static.ts:199-205: any method other than GET/HEAD returnsmethod_not_allowedbefore the path is checked.toolkits/blueprint-go-react/template/main.go:385andtoolkits/blueprint-rust-react/template/src/main.rs:607.Suggested fix
/api/(and especially/api/_a2app/) should return 404unknown_routefrom the adapter instead of reaching the static handler. For POSTs, include a hint such as:Operations are invoked with POST /api/ops/<name>; see /api/_a2app/describe for the list.POST /api/_a2app/does-not-exist→ 404 with the hint;POST /index.html→ 405.