tangcent / easy-api

Generate API document

Home Page:https://easyapi.itangcent.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature] 系统内部使用是否这种布尔类型在系统内部都是boolean,但是想导出为integer[0,1], 怎么配置呢?

Jinyun-Liu opened this issue · comments

我看枚举已经可以配置值,类型两个转换规则;

枚举值转换

enum.use.custom[groovy:it.isExtend("xyz.jinyun.springboot.common.BaseEnum")]=code

枚举类型转换

json.rule.enum.convert[groovy:it.isExtend("xyz.jinyun.springboot.common.BaseEnum")]=~#code

但是如果是Boolean xx; 这种字段,导出的api也是布尔类型,可以转成0 1吗?我这样配置不生效:

true-1 false-0

json.rule.convert[java.lang.Boolean]=java.lang.Integer

json.rule.convert[java.lang.Boolean]=java.lang.Integer 这么配置没问题生效了。