Response entity type ignores fields (fields inherit from non modifiable parent class, from mybaits flex)
Hans-Wu-cn opened this issue · comments
hansWu commented
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
development environment
java:21
smart-doc:3.0.2
mybatis-flex:1.7.9
孙宇 commented
@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"
}
]
}
```