Mercurial > hg > thermostat-ng > web-gateway
view services/commands/src/main/webapp/WEB-INF/web.xml @ 292:1738c834713c
Add schema service to serve combined API swagger file
This patch serves an uber-api Swagger file from URL
https://127.0.0.1:30000/schema/fullapi-swagger.yaml (or ... .json)
Rviewed-by: sgehwolf
Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2017-October/025369.html
author | Simon Tooke <stooke@redhat.com> |
---|---|
date | Tue, 24 Oct 2017 14:46:18 -0400 |
parents | d4290a3f1e03 |
children | 8ecf97835acd |
line wrap: on
line source
<!-- Copyright 2012-2017 Red Hat, Inc. This file is part of Thermostat. Thermostat is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. Thermostat is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Thermostat; see the file COPYING. If not see <http://www.gnu.org/licenses/>. Linking this code with other modules is making a combined work based on this code. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this code give you permission to link this code with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this code. If you modify this code, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. --> <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1"> <servlet> <servlet-name>StaticResourcesServlet</servlet-name> <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class> <init-param> <param-name> jersey.config.server.provider.packages </param-name> <param-value> com.redhat.thermostat.gateway.service.commands.http.handlers, </param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>StaticResourcesServlet</servlet-name> <url-pattern>/v1/static/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>StaticResourcesServlet</servlet-name> <url-pattern>/v1/doc/*</url-pattern> </servlet-mapping> <!-- Listener for setting up the websocket handlers --> <listener> <listener-class>com.redhat.thermostat.gateway.service.commands.servlet.SocketRegistrationListener</listener-class> </listener> <!-- Context configuration --> <context-param> <param-name>com.redhat.thermostat.gateway.SERVICE_VERSION</param-name> <param-value>v1</param-value> </context-param> <!-- allow querying API version without authentication --> <security-constraint> <web-resource-collection> <web-resource-name>Version</web-resource-name> <url-pattern>/version</url-pattern> </web-resource-collection> </security-constraint> <!-- Allow viewing of API spec without authentication --> <security-constraint> <web-resource-collection> <web-resource-name>Swagger API SPEC YAML File</web-resource-name> <url-pattern>/v1/doc/@com.redhat.thermostat.gateway.SERVICE_NAME@-swagger.yaml</url-pattern> </web-resource-collection> <!-- Explicitly no auth constraint for this file --> </security-constraint> </web-app>