File tree Expand file tree Collapse file tree
src/main/java/io/github/devopsws/demo Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ Run E2E testing:
77make build-image test-e2e
88```
99
10+ ## OpenAPI definition
11+ You can visit it via: http://localhost:8080/v3/api-docs
12+
13+ or visit Swagger UI via: http://localhost:8080/swagger-ui/index.html
14+
1015## GraphQL
1116You can visit it via: http://localhost:8080/graphiql?path=/graphql
1217
Original file line number Diff line number Diff line change 99- name : health
1010 request :
1111 api : /health
12+ - name : healthJson
13+ request :
14+ api : /health.json
15+ header :
16+ Authorization : " {{ .param.auth }}"
17+ expect :
18+ body : |
19+ {"message":"OK"}
1220 - name : toLowerWithoutParam
1321 request :
1422 api : /lower
Original file line number Diff line number Diff line change 4747 <version >1.1.0</version >
4848 </dependency >
4949
50+ <dependency >
51+ <groupId >org.springdoc</groupId >
52+ <artifactId >springdoc-openapi-starter-webmvc-ui</artifactId >
53+ <version >2.2.0</version >
54+ </dependency >
55+
5056 <dependency >
5157 <groupId >org.springframework.boot</groupId >
5258 <artifactId >spring-boot-starter-test</artifactId >
Original file line number Diff line number Diff line change 1+ package io .github .devopsws .demo .model ;
2+
3+ public class Message {
4+ private String message ;
5+
6+ public Message (String message ) {
7+ this .message = message ;
8+ }
9+
10+ public String getMessage () {
11+ return this .message ;
12+ }
13+
14+ public void setMessage (String message ) {
15+ this .message =message ;
16+ }
17+ }
Original file line number Diff line number Diff line change 22
33import org .springframework .web .bind .annotation .GetMapping ;
44import org .springframework .web .bind .annotation .RestController ;
5+ import io .github .devopsws .demo .model .Message ;
56
67@ RestController
78public class HealthService {
89 @ GetMapping ("/health" )
910 public String health () {
1011 return "OK" ;
1112 }
13+
14+ @ GetMapping ("/health.json" )
15+ public Message healthJSON () {
16+ return new Message ("OK" );
17+ }
1218}
You can’t perform that action at this time.
0 commit comments