With Spring Boot, JsonDoc nicely detects all the controllers but it doesn't detect models which are located in another maven module.
Our project has 2 modules:
- my-app-core
- my-app-impl
The main controllers as well as properties files e.g. application.properties are located in my-app-core and the followings are jsondoc's configurations:
# mandatory configuration
jsondoc.version=1.0
jsondoc.basePath=http://localhost:8090
jsondoc.packages[0]=com.myapp
jsondoc.packages[1]=com.myapp.api.docs.GlobalDocumentation
jsondoc.packages[2]=com.myapp.api.docs.ChangeLogDocumentation
jsondoc.packages[3]=com.myapp.api.jsonapi.model
# optional configuration
jsondoc.playgroundEnabled=true
jsondoc.displayMethodAs=URI
The package com.myapp.api.jsonapi.model is in the other module my-app-impl and JSONDoc doesn't detect them.
Below is a sample annotated model
@JsonApiResource(type="advisers")
@ApiObject(description = "Adviser model")
public class Adviser {
@JsonApiId
@ApiObjectField(description = "ID")
private Integer id;
@ApiObjectField(description = "Adviser's name")
private String name;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}