This repository was archived by the owner on Oct 30, 2023. It is now read-only.
File tree 3 files changed +12
-14
lines changed
java/java-resteasy/src/main
3 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -31,9 +31,7 @@ public void init(ServletConfig config) throws ServletException {
31
31
32
32
ServletContext context = config .getServletContext ();
33
33
Swagger swagger = new Swagger ()
34
- .info (info )
35
- .basePath ("/api" )
36
- .host ("localhost:8002" );
34
+ .info (info );
37
35
swagger .securityDefinition ("petstore_auth" ,
38
36
new OAuth2Definition ()
39
37
.implicit ("http://localhost:8002/oauth/dialog" )
Original file line number Diff line number Diff line change 1
1
package io .swagger .sample ;
2
2
3
+ import io .swagger .jaxrs .config .BeanConfig ;
3
4
import io .swagger .sample .resource .PetResource ;
4
5
import io .swagger .sample .resource .PetStoreResource ;
5
6
import io .swagger .sample .resource .UserResource ;
11
12
public class PetStoreApplication extends Application {
12
13
HashSet <Object > singletons = new HashSet <Object >();
13
14
14
- public PetStoreApplication () { }
15
+ public PetStoreApplication () {
16
+ BeanConfig beanConfig = new BeanConfig ();
17
+ beanConfig .setVersion ("1.0.2" );
18
+ beanConfig .setSchemes (new String []{"http" });
19
+ beanConfig .setHost ("localhost:8002" );
20
+ beanConfig .setBasePath ("/api" );
21
+ beanConfig .setFilterClass ("io.swagger.sample.util.ApiAuthorizationFilterImpl" );
22
+ beanConfig .setResourcePackage ("io.swagger.sample.resource" );
23
+ beanConfig .setScan (true );
24
+ }
15
25
16
26
@ Override
17
27
public Set <Class <?>> getClasses () {
Original file line number Diff line number Diff line change 23
23
<url-pattern >/api/*</url-pattern >
24
24
</servlet-mapping >
25
25
26
- <servlet >
27
- <servlet-name >DefaultJaxrsConfig</servlet-name >
28
- <servlet-class >io.swagger.jaxrs.config.DefaultJaxrsConfig</servlet-class >
29
- <init-param >
30
- <param-name >swagger.filter</param-name >
31
- <param-value >io.swagger.sample.util.ApiAuthorizationFilterImpl</param-value >
32
- </init-param >
33
- <load-on-startup >2</load-on-startup >
34
- </servlet >
35
-
36
26
<filter >
37
27
<filter-name >ApiOriginFilter</filter-name >
38
28
<filter-class >io.swagger.sample.util.ApiOriginFilter</filter-class >
You can’t perform that action at this time.
0 commit comments