Spring Boot with JsonDoc demo for your REST APIs documentation and playground. In this project is used also Lombok for simplifing POJOs.
mvn clean install
java -jar spring-boot-jsondoc-demo-0.0.1-SNAPSHOT.jar
go to http://localhost:8080/jsondoc-ui.html?url=jsondoc
cd bin
sh build.sh
sh run.sh
go to http://localhost:8080/jsondoc-ui.html?url=jsondoc
docker build -t spring-boot-jsondoc-demo:latest .
docker run -d -p 8080:8080 -ti spring-boot-jsondoc-demo:latest
go to http://localhost:8080/jsondoc-ui.html?url=jsondoc
docker pull quay.io/peterszatmary/spring-boot-jsondoc-demo
docker run -d -p 8080:8080 -ti spring-boot-jsondoc-demo:latest
go to http://localhost:8080/jsondoc-ui.html?url=jsondoc
@RequestMapping(value = "/hello")
public @ResponseBody
String hello() {
return "hello";
}
@RequestMapping(value = "/car")
public @ResponseBody
Car car() {
return new Car("BMW", new Owner("owner of BMW"));
}
@ApiObject(name="Car", description = "Car object represents cars.")
@AllArgsConstructor
@NoArgsConstructor
@Data
public class Car {
@ApiObjectField(description = "Just simple car name")
private String name;
@ApiObjectField(description = "Car owner")
private Owner owner;
}
@AllArgsConstructor
@NoArgsConstructor
@Data
@ApiObject(name="Owner", description = "Owner of car.")
public class Owner {
@ApiObjectField(description = "Owner name and surname.")
private String name;
}