TongchengOpenSource / smart-doc

Smart-doc is a java restful api document generation tool. Smart-doc is based on interface source code analysis to generate interface documentation, completely zero-injection.

Home Page:https://smart-doc-group.github.io/#/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Response entity type ignores fields (fields inherit from non modifiable parent class, from mybaits flex)

Hans-Wu-cn opened this issue · comments

Summary

When the response entity type inherits Modelfrom mybatis flex, the generated document will have many extra fields. If it is possible to ignore certain classes by configuring them to not generate related documents, it would be better
image
image

development environment

java:21
smart-doc:3.0.2
mybatis-flex:1.7.9

@Hans-Wu-cn There are two ways to ignore response fields, one is using JSONType, for example:

@JSONType(ignores ={"current", "size", "orders", "hitCount", "searchCount", "pages","optimizeCountSql"})
@JsonIgnoreProperties({"current", "size", "orders", "hitCount", "searchCount", "pages","optimizeCountSql"})
public class MybatisPlusPage<T> extends Page<T> {
    // ...
}

Another way to configure is through customResponseFields, for example:

{
    "customResponseFields": [
        {
            "name": "code",
            "desc": "response code",
            "ownerClassName": "org.springframework.data.domain.Pageable",
            "ignore": true,
            "value": "00000"
        }
    ]
}
```