diff --git a/README.md b/README.md
index 2af7c4a..e6e9b3c 100644
--- a/README.md
+++ b/README.md
@@ -7,6 +7,11 @@ Run E2E testing:
make build-image test-e2e
```
+## OpenAPI definition
+You can visit it via: http://localhost:8080/v3/api-docs
+
+or visit Swagger UI via: http://localhost:8080/swagger-ui/index.html
+
## GraphQL
You can visit it via: http://localhost:8080/graphiql?path=/graphql
diff --git a/e2e/test-suite.yaml b/e2e/test-suite.yaml
index 87c05e9..82c6ddf 100644
--- a/e2e/test-suite.yaml
+++ b/e2e/test-suite.yaml
@@ -9,6 +9,14 @@ items:
- name: health
request:
api: /health
+- name: healthJson
+ request:
+ api: /health.json
+ header:
+ Authorization: "{{ .param.auth }}"
+ expect:
+ body: |
+ {"message":"OK"}
- name: toLowerWithoutParam
request:
api: /lower
diff --git a/pom.xml b/pom.xml
index 6d0a9f0..8af47bf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -47,6 +47,12 @@
1.1.0
+
+ org.springdoc
+ springdoc-openapi-starter-webmvc-ui
+ 2.2.0
+
+
org.springframework.boot
spring-boot-starter-test
diff --git a/src/main/java/io/github/devopsws/demo/model/Message.java b/src/main/java/io/github/devopsws/demo/model/Message.java
new file mode 100644
index 0000000..8843007
--- /dev/null
+++ b/src/main/java/io/github/devopsws/demo/model/Message.java
@@ -0,0 +1,17 @@
+package io.github.devopsws.demo.model;
+
+public class Message {
+ private String message;
+
+ public Message(String message) {
+ this.message = message;
+ }
+
+ public String getMessage() {
+ return this.message;
+ }
+
+ public void setMessage(String message) {
+ this.message=message;
+ }
+}
diff --git a/src/main/java/io/github/devopsws/demo/service/HealthService.java b/src/main/java/io/github/devopsws/demo/service/HealthService.java
index f2ff0c6..d3e0baf 100644
--- a/src/main/java/io/github/devopsws/demo/service/HealthService.java
+++ b/src/main/java/io/github/devopsws/demo/service/HealthService.java
@@ -2,6 +2,7 @@
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
+import io.github.devopsws.demo.model.Message;
@RestController
public class HealthService {
@@ -9,4 +10,9 @@ public class HealthService {
public String health() {
return "OK";
}
+
+ @GetMapping("/health.json")
+ public Message healthJSON() {
+ return new Message("OK");
+ }
}