You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Breaking) #581#589DynamicHttpService is merged into the core. Also, HTTP parameters are automatically injected as arguments when calling an annotated service method. Your code will fail to compile if you wrote your service using DynamicHttpService.
DynamicHttpServiceBuilder class is removed. You can use ServerBuilder.annotatedService(...) to add an annotated service object to the builder as follows:
ServerBuildersb = ...;
// Using a query parameter (e.g. /greet5?name=alice) on an annotated service object:sb.annotatedService(newObject() {
@Get("/greet5")
publicHttpResponsegreet(@Param("name") Stringname,
@Param("title") @Optional("Mr.") Stringtitle) {
// "Mr." is used by default if there is no title parameter in the request.returnHttpResponse.of(HttpStatus.OK, MediaType.PLAIN_TEXT_UTF_8,
"Hello, %s %s!", title, name);
}
});
@PathParam annotation has been replaced with @param, which is much shorter and handles query parameters as well.
The package name of HTTP method anntations, such as @Get, is changed to com.linecorp.armeria.server.http.annotation from com.linecorp.armeria.server.http.dynamic.
#584#585 Provide more ways to specify a path pattern. The following patterns would be accepted as a path pattern.
/login (no path parameters)
/users/{userId} (curly-brace style)
/list/:productType/by/:ordering (colon style)
exact:/foo/bar (exact match)
prefix:/files (prefix match)
glob:/~*/downloads/** (glob pattern)
regex:^/files/(?.*)$ (regular expression)
#593 Restore prefix mapping stripping to allow it to work together with arbitrarily mapped PathMappingResult. ServiceRequestContext.mappedPath() would return the value from PathMappingResult.path().