tangcent / easy-yapi

Generate API document to yapi
https://easyyapi.com
GNU Affero General Public License v3.0
439 stars 144 forks source link

子类如何重写父类的注释? #1140

Open he429134733 opened 6 months ago

he429134733 commented 6 months ago

class A { /**

class B extend A {

/**

} }

我用这种方式上传到yapi上,是没有作用的,我应该怎么做?

tangcent commented 6 months ago

没有做这样的支持,不过你可以自定义配置来试试:

json.class.parse.before=groovy:```
  it.methods().each {
      def name = it.name()
      if(!name.startsWith("get")){
          return
      }
      logger.debug("name:"+name)
      def doc = it.doc()
      if(tool.isNullOrEmpty(doc)){
          return
      }
      logger.debug("doc:"+doc)
      session[tool.uncapitalize(name.substring(3))] = doc
  }

field.doc=groovy:session[it.name()]