What problem does it solve?
This skill documents patterns and best practices for building REST gateway controllers that reliably delegate to gRPC backend services, preventing leaking proto types into REST responses and reducing duplicated mapping logic.
Core Features & Use Cases
- Versioned controller base: Enforce a ControllerBaseV1 that centralizes route constants and OpenAPI grouping for consistent API surface across gateways.
- Constructor-injected gRPC clients: Recommend primary constructor injection with backing readonly fields for typed gRPC clients to keep controllers thin and testable.
- Inline mapping and response models: Map gRPC responses to REST DTOs inline, use Paginated<T> for list endpoints, and wrap command results in a simple Response { Message } model.
- Error handling and security: Provide RpcException handling patterns, rely on global filters for most errors, and apply class-level Authorize attributes with Policy or Roles.
Quick Start
Add a new controller that inherits ControllerBaseV1, injects the typed gRPC client in the constructor, maps responses to REST DTOs inline, and returns Paginated<T> for list endpoints.