This repository was archived by the owner on Oct 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 880
/
Copy pathweb.xml
86 lines (80 loc) · 3.02 KB
/
web.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<servlet>
<servlet-name>jersey</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<!-- adding 'io.swagger.jaxrs2.integration.listing' is sufficent on it own to register the following paths:
/openApi.json : OpenApi spec in json
/openApi.yaml : OpenApi spec in yaml
/openApi (Accept: : "application/json" : OpenApi spec in json
/openApi (Accept: : "application/yaml" : OpenApi spec in yaml
<param-value>
com.fasterxml.jackson.jaxrs.json,io.swagger.jaxrs2.integration.listing,io.swagger.sample.resource
</param-value>
-->
<param-value>
com.fasterxml.jackson.jaxrs.json,io.swagger.sample.resource
</param-value>
</init-param>
<!-- specify config location
<init-param>
<param-name>openApi.configuration.location</param-name>
<param-value>/openapi-configuration.json</param-value>
</init-param>
-->
<init-param>
<param-name>jersey.config.server.wadl.disableWadl</param-name>
<param-value>true</param-value>
</init-param>
<!-- specify resource package
<init-param>
<param-name>openApi.configuration.resourcePackage</param-name>
<param-value>com.fasterxml.jackson.jaxrs.json,io.swagger.sample.resource</param-value>
</init-param>
-->
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>jersey</servlet-name>
<url-pattern>/api/*</url-pattern>
</servlet-mapping>
<filter>
<filter-name>ApiOriginFilter</filter-name>
<filter-class>io.swagger.sample.util.ApiOriginFilter</filter-class>
</filter>
<servlet>
<!-- use OpenApi servlet to serve spec -->
<servlet-name>OpenApi</servlet-name>
<servlet-class>io.swagger.jaxrs2.integration.OpenApiServlet</servlet-class>
<!-- specify resource package
<init-param>
<param-name>openApi.configuration.resourcePackage</param-name>
<param-value>com.fasterxml.jackson.jaxrs.json,io.swagger.sample.resource</param-value>
</init-param>
-->
<init-param>
<param-name>openApi.configuration.location</param-name>
<param-value>/openapi-configuration.json</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>OpenApi</servlet-name>
<url-pattern>/openapi/*</url-pattern>
</servlet-mapping>
<!-- use own Bootstrap servlet
<servlet>
<servlet-name>Bootstrap</servlet-name>
<servlet-class>io.swagger.sample.Bootstrap</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
-->
<filter-mapping>
<filter-name>ApiOriginFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>