shelf_routing library

Classes

GenerateRouterFor
Annotation for top level getters to generate a router that handles all routers of the types passed using the package shelf_routing_generator.
GetterMiddleware
Middleware to inject _getter to retrieve data by dependency injection.
JsonResponse<T>
The json response returned by a Handler.
Routable
Annotation for services using on methods the Route annotation to add a prefix when the router is mounted via the GenerateRouterFor annotation using the package shelf_routing_generator.
RouteHeader
Annotation for methods using Route annotation to indicate that the route should be called with this the header name using the package shelf_routing_generator.

Enums

BadRequestPosition
Identifies the data type of the request.

Extensions

GetterRequestExtensions on Request
Dependency injection extensions.

Functions

$ensureHasHeader(Request request, String name) → void
Generator utils
$parsePathParameter<T>(String value, T parser(String vl)) → T
Generator utils
$parseQueryParameters<T>(Request request, String name, T parser(List<String> vls)) → T
Generator utils
$readBodyAs<T>(Request request, T converter(Map<String, dynamic> data)) Future<T>
Generator utils

Typedefs

RequestGetter = T Function<T extends Object>(Request request)
Getter definition for dependency injection.

Exceptions / Errors

BadRequestException
The exception that will be thrown in case the validation/parsing of the request fails.