File tree Expand file tree Collapse file tree 5 files changed +1164
-2
lines changed
modules/swagger-generator
java/io/swagger/generator/online Expand file tree Collapse file tree 5 files changed +1164
-2
lines changed Original file line number Diff line number Diff line change 1
1
openapi : 3.0.0
2
2
servers :
3
- - url : /v2
3
+ - url : /
4
4
info :
5
5
description : codegen generator server API
6
6
version : " 1.0.0"
Original file line number Diff line number Diff line change 33
33
</archive >
34
34
</configuration >
35
35
</plugin >
36
+ <plugin >
37
+ <groupId >org.apache.maven.plugins</groupId >
38
+ <artifactId >maven-war-plugin</artifactId >
39
+ <version >3.1.0</version >
40
+ <configuration >
41
+ <webResources >
42
+ <resource >
43
+ <!-- this is relative to the pom.xml directory -->
44
+ <directory >${project.build.directory} /swagger-ui-master/dist</directory >
45
+ <excludes >
46
+ <exclude >index.html</exclude >
47
+ </excludes >
48
+ </resource >
49
+ </webResources >
50
+ </configuration >
51
+ </plugin >
36
52
<plugin >
37
53
<artifactId >maven-dependency-plugin</artifactId >
38
54
<executions >
173
189
<artifactId >swagger-inflector</artifactId >
174
190
<version >${inflector-version} </version >
175
191
</dependency >
192
+ <dependency >
193
+ <groupId >javax.servlet</groupId >
194
+ <artifactId >servlet-api</artifactId >
195
+ <version >${servlet-api.version} </version >
196
+ </dependency >
176
197
<dependency >
177
198
<groupId >org.testng</groupId >
178
199
<artifactId >testng</artifactId >
187
208
<junit-version >4.8.2</junit-version >
188
209
<slf4j-version >1.6.3</slf4j-version >
189
210
<swagger-codegen-generators-version >1.0.0-SNAPSHOT</swagger-codegen-generators-version >
211
+ <servlet-api .version>2.5</servlet-api .version>
190
212
</properties >
191
213
</project >
Original file line number Diff line number Diff line change
1
+ package io .swagger .generator .online ;
2
+
3
+ import org .apache .commons .io .IOUtils ;
4
+
5
+ import javax .servlet .http .HttpServlet ;
6
+ import javax .servlet .http .HttpServletRequest ;
7
+ import javax .servlet .http .HttpServletResponse ;
8
+ import javax .ws .rs .core .MediaType ;
9
+ import java .io .IOException ;
10
+
11
+ public class PetstoreServlet extends HttpServlet {
12
+
13
+ protected void doGet (HttpServletRequest request , HttpServletResponse response ) throws IOException {
14
+ String json = IOUtils .toString (getClass ().getResourceAsStream ("/petstore.json" ));
15
+ response .setContentType (MediaType .APPLICATION_JSON );
16
+ response .setStatus (HttpServletResponse .SC_OK );
17
+
18
+ response .getWriter ().append (json );
19
+
20
+ }
21
+ }
You can’t perform that action at this time.
0 commit comments