Search in sources :

Example 76 with ApiParam

use of io.swagger.annotations.ApiParam in project smarthome by eclipse.

the class BindingResource method getAll.

@GET
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(value = "Get all bindings.", response = BindingInfoDTO.class, responseContainer = "Set")
@ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = BindingInfoDTO.class, responseContainer = "Set") })
public Response getAll(@HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @ApiParam(value = "language") String language) {
    final Locale locale = localeService.getLocale(language);
    Set<BindingInfo> bindingInfos = bindingInfoRegistry.getBindingInfos(locale);
    return Response.ok(new Stream2JSONInputStream(bindingInfos.stream().map(b -> map(b, locale)))).build();
}
Also used : Locale(java.util.Locale) PathParam(javax.ws.rs.PathParam) LocaleService(org.eclipse.smarthome.io.rest.LocaleService) RolesAllowed(javax.annotation.security.RolesAllowed) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) BindingInfoDTO(org.eclipse.smarthome.core.binding.dto.BindingInfoDTO) Path(javax.ws.rs.Path) LoggerFactory(org.slf4j.LoggerFactory) ApiParam(io.swagger.annotations.ApiParam) ApiResponses(io.swagger.annotations.ApiResponses) ApiOperation(io.swagger.annotations.ApiOperation) MediaType(javax.ws.rs.core.MediaType) Component(org.osgi.service.component.annotations.Component) Consumes(javax.ws.rs.Consumes) Locale(java.util.Locale) Map(java.util.Map) ConfigDescription(org.eclipse.smarthome.config.core.ConfigDescription) HeaderParam(javax.ws.rs.HeaderParam) ConfigurationService(org.eclipse.smarthome.io.rest.core.config.ConfigurationService) URI(java.net.URI) Api(io.swagger.annotations.Api) Status(javax.ws.rs.core.Response.Status) Configuration(org.eclipse.smarthome.config.core.Configuration) RESTResource(org.eclipse.smarthome.io.rest.RESTResource) Context(javax.ws.rs.core.Context) Logger(org.slf4j.Logger) Set(java.util.Set) IOException(java.io.IOException) Stream2JSONInputStream(org.eclipse.smarthome.io.rest.Stream2JSONInputStream) ReferencePolicy(org.osgi.service.component.annotations.ReferencePolicy) ConfigDescriptionRegistry(org.eclipse.smarthome.config.core.ConfigDescriptionRegistry) Role(org.eclipse.smarthome.core.auth.Role) ReferenceCardinality(org.osgi.service.component.annotations.ReferenceCardinality) BindingInfoRegistry(org.eclipse.smarthome.core.binding.BindingInfoRegistry) HttpHeaders(javax.ws.rs.core.HttpHeaders) Response(javax.ws.rs.core.Response) ApiResponse(io.swagger.annotations.ApiResponse) BindingInfo(org.eclipse.smarthome.core.binding.BindingInfo) PUT(javax.ws.rs.PUT) UriInfo(javax.ws.rs.core.UriInfo) Reference(org.osgi.service.component.annotations.Reference) Collections(java.util.Collections) ConfigUtil(org.eclipse.smarthome.config.core.ConfigUtil) BindingInfo(org.eclipse.smarthome.core.binding.BindingInfo) Stream2JSONInputStream(org.eclipse.smarthome.io.rest.Stream2JSONInputStream) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) ApiOperation(io.swagger.annotations.ApiOperation) ApiResponses(io.swagger.annotations.ApiResponses)

Aggregations

ApiParam (io.swagger.annotations.ApiParam)76 ApiOperation (io.swagger.annotations.ApiOperation)69 Api (io.swagger.annotations.Api)65 Path (javax.ws.rs.Path)57 List (java.util.List)55 ApiResponse (io.swagger.annotations.ApiResponse)52 PathParam (javax.ws.rs.PathParam)52 ApiResponses (io.swagger.annotations.ApiResponses)51 GET (javax.ws.rs.GET)51 Produces (javax.ws.rs.Produces)50 Response (javax.ws.rs.core.Response)50 Collectors (java.util.stream.Collectors)48 PUT (javax.ws.rs.PUT)43 Logger (org.slf4j.Logger)43 LoggerFactory (org.slf4j.LoggerFactory)43 POST (javax.ws.rs.POST)40 DELETE (javax.ws.rs.DELETE)39 MediaType (javax.ws.rs.core.MediaType)38 Inject (javax.inject.Inject)37 QueryParam (javax.ws.rs.QueryParam)37