easy-yapi icon indicating copy to clipboard operation
easy-yapi copied to clipboard

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

Open he429134733 opened this issue 1 year ago • 1 comments

class A { /**

  • 父类的注释 **/ private String name; }

class B extend A {

/**

  • 重写的注释 */ public String getName(){

} }

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

he429134733 avatar May 14 '24 03:05 he429134733

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

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()]

tangcent avatar May 14 '24 23:05 tangcent

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Mar 03 '25 01:03 github-actions[bot]