module
用于分类api#find module from comment tag
module=#module
#ignore class or method which has comment tag 'ignore'
ignore=#ignore
method.doc[#deprecated]=groovy:"\n「deprecated」" + it.doc("deprecated")
method.doc[@java.lang.Deprecated]=「deprecated」
method.doc[@kotlin.Deprecated]=groovy:"\n「deprecated」" + it.ann("kotlin.Deprecated","message")
method.doc[groovy:it.containingClass().hasDoc("deprecated")]=groovy:"\n「deprecated」" + it.containingClass().doc("deprecated")
method.doc[groovy:it.containingClass().hasAnn("java.lang.Deprecated")]=「deprecated」
method.doc[groovy:it.containingClass().hasAnn("kotlin.Deprecated")]=groovy:"\n「deprecated」 " + it.containingClass().ann("kotlin.Deprecated","message")
## security description
method.doc[@javax.annotation.security.RolesAllowed]=groovy:"require role:"+it.ann("javax.annotation.security.RolesAllowed")
## security description
doc.method[@org.springframework.security.access.prepost.PreAuthorize]=groovy:```
def preAuthorize = it.ann("org.springframework.security.access.prepost.PreAuthorize")
if(tool.nullOrBlank(preAuthorize)){
return
}
def role = regex.getGroup1("hasRole\\('(.*?)'\\)",preAuthorize)
return "require role: $role"
```
## ignore field 'log'
json.rule.field.ignore=log
## ignore field 'log' typed xxx.xxx.Log
json.rule.field.ignore=groovy:it.type().name()=="xxx.xxx.Log"
#ignore transient field
json.rule.field.ignore=groovy:it.hasModifier("transient")
java.time.LocalDateTime
作为yyyy-mm-dd
形式字符串处理#Resolve 'java.time.LocalDateTime' as 'java.lang.String'
json.rule.convert[java.time.LocalDateTime]=java.lang.String
json.rule.convert[java.time.LocalDate]=java.lang.String
java.time.LocalDateTime
作为timestamp
处理#Resolve 'java.time.LocalDateTime' as 'java.lang.Long'
json.rule.convert[java.time.LocalDateTime]=java.lang.Long
json.rule.convert[java.time.LocalDate]=java.lang.Long
method.doc[#result]=groovy: it.docs("result").collect{helper.resolveLink(it)}.grep{it!=null}.collect{"可能的返回:\n\n```json\n"+it.toJson(true)+"\n```\n\n"}.join("\n")
/**
* @result {@link UserInfo}
* @result {@link Result<UserInfo>}
*/
public Result mockString() {
...
}
field.doc[#maybe]=groovy:it.docs("maybe").collect{helper.resolveLink(it)}.collect{"可能是:\n\n```json\n" + it.toJson(true) +"\n```\n\n"}.join("\n")
/**
* @maybe {@link UserInfo}
* @maybe {@link java.lang.String}
*/
public Object target;
javax.validation
, 勾选javax.validation(grouped)
Jackson_JsonIgnoreProperties
com.xxx.Xxx is to complex. Blocked cause by xxx reached xxx
, 如何处理# ignore field with type com.xxx.Xxx
field.ignore=groovy:it.type().name()=="com.xxx.Xxx"
max.deep=8
max.elements=512