Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
he429134733 opened this issue May 14, 2024 · 1 comment
Open

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

he429134733 opened this issue May 14, 2024 · 1 comment
Labels
type: question&discussion Further information is requested

Comments

@he429134733
Copy link

class A {
/**

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

class B extend A {

/**

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

}
}

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

@he429134733 he429134733 added the type: question&discussion Further information is requested label May 14, 2024
@tangcent
Copy link
Owner

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question&discussion Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants