Java 类io.swagger.annotations.ExternalDocs 实例源码

项目:camunda-bpm-swagger    文件:ApiOperationStep.java   
public void annotate(final MethodStep methodStep, final Method m) {

    // resources are not annotated at all, because the resource itself will contain a method
    // that will get into the public API. It is a method with GET annotation and empty path.
    if (!TypeHelper.isResource(methodStep.getReturnType())) {
      final String description = restOperation != null && restOperation.getDescription() != null ? restOperation.getDescription() : WordUtils.capitalize(StringHelper.splitCamelCase(m.getName()));

      getMethod().annotate(ApiOperation.class) //
        .param("value", StringHelper.firstSentence(description))
        .param("notes", description)
      ;

      if (restOperation != null && restOperation.getExternalDocUrl() != null) {
        getMethod().annotate(ExternalDocs.class)
          .param("value", "Reference Guide")
          .param("url", restOperation.getExternalDocUrl())
        ;
      }
    }
  }