Priority
P1
Problem
Croco exposes an @All REST decorator, but the generated-contract layer does not define how ALL routes should be represented. The HTTP transport registers all routes successfully, openapi-spec rejects ALL, and rpc-codegen would emit method: 'ALL', which is not a concrete request method for generated clients.
Evidence
packages/protocols-rest/src/libs/decorators/HttpMethod.ts exports All = createMethodDecorator(HttpMethodEnum.ALL).
packages/protocols-rest/src/tests/decorators/Route.spec.ts verifies that @All() registers HttpMethod.ALL.
packages/transports-http/src/libs/CrocoRouteRegistrar.ts handles case "all" with this.hono.all(route.path, honoHandler).
packages/openapi-spec/src/libs/emitOpenAPI.ts limits methods to get, post, put, delete, patch, head, options, and trace, then throws Unsupported HTTP method: ${method} for anything else.
packages/rpc-codegen/src/libs/generate.ts directly emits method: '${route.httpMethod.toUpperCase()}', so an ALL route becomes fetch(..., { method: 'ALL' }).
- OpenAPI Path Item fixed fields enumerate concrete operations such as
get, put, post, delete, options, head, patch, and trace; there is no all operation field: https://spec.openapis.org/oas/v3.1.2.html#path-item-object
Desired outcome
Croco makes @All behavior explicit at codegen boundaries instead of generating invalid clients or failing with a generic unsupported-method error.
Proposed implementation path
- Decide the contract for generated surfaces: either exclude
@All routes with a clear diagnostic, or expand them into concrete methods where that is safe.
- Apply the same policy in
openapi-spec and rpc-codegen so generated docs and clients agree.
- Add tests covering a controller with
@All() for OpenAPI and RPC generation.
- If routes are rejected, include controller/method/path in the error so users can resolve it without debugging metadata.
Acceptance criteria
emitOpenAPI no longer fails with an unqualified Unsupported HTTP method: ALL for @All routes.
rpc-codegen never emits method: 'ALL' in generated fetch clients.
- The chosen behavior is documented by tests in both generated-contract packages.
- HTTP runtime
@All behavior remains unchanged in transports-http.
Validation
pnpm test --filter=@croco/openapi-spec
pnpm test --filter=@croco/rpc-codegen
pnpm typecheck --filter=@croco/openapi-spec --filter=@croco/rpc-codegen
Scope boundaries
- This does not require removing the
@All decorator.
- This does not require adding OpenAPI vendor extensions unless the chosen policy needs them.
- This does not redefine route precedence in the HTTP transport.
Priority
P1
Problem
Croco exposes an
@AllREST decorator, but the generated-contract layer does not define howALLroutes should be represented. The HTTP transport registersallroutes successfully,openapi-specrejectsALL, andrpc-codegenwould emitmethod: 'ALL', which is not a concrete request method for generated clients.Evidence
packages/protocols-rest/src/libs/decorators/HttpMethod.tsexportsAll = createMethodDecorator(HttpMethodEnum.ALL).packages/protocols-rest/src/tests/decorators/Route.spec.tsverifies that@All()registersHttpMethod.ALL.packages/transports-http/src/libs/CrocoRouteRegistrar.tshandlescase "all"withthis.hono.all(route.path, honoHandler).packages/openapi-spec/src/libs/emitOpenAPI.tslimits methods toget,post,put,delete,patch,head,options, andtrace, then throwsUnsupported HTTP method: ${method}for anything else.packages/rpc-codegen/src/libs/generate.tsdirectly emitsmethod: '${route.httpMethod.toUpperCase()}', so anALLroute becomesfetch(..., { method: 'ALL' }).get,put,post,delete,options,head,patch, andtrace; there is noalloperation field: https://spec.openapis.org/oas/v3.1.2.html#path-item-objectDesired outcome
Croco makes
@Allbehavior explicit at codegen boundaries instead of generating invalid clients or failing with a generic unsupported-method error.Proposed implementation path
@Allroutes with a clear diagnostic, or expand them into concrete methods where that is safe.openapi-specandrpc-codegenso generated docs and clients agree.@All()for OpenAPI and RPC generation.Acceptance criteria
emitOpenAPIno longer fails with an unqualifiedUnsupported HTTP method: ALLfor@Allroutes.rpc-codegennever emitsmethod: 'ALL'in generated fetch clients.@Allbehavior remains unchanged intransports-http.Validation
pnpm test --filter=@croco/openapi-specpnpm test --filter=@croco/rpc-codegenpnpm typecheck --filter=@croco/openapi-spec --filter=@croco/rpc-codegenScope boundaries
@Alldecorator.