Azure/azure-functions-java-library

Incorrect Javadoc comment in HttpTrigger.java

m-moris opened this issue · 2 comments

The following Javadoc describes the HttpTriger route method, but the sample described is incorrect and causes a compile error.

https://docs.microsoft.com/en-us/java/api/com.microsoft.azure.functions.annotation.httptrigger.route?view=azure-java-stable#com_microsoft_azure_functions_annotation_HttpTrigger_route__

The correct method type is HttpResponseMessage, not HttpResponseMessage<String>.

@FunctionName("routeTest")
  public HttpResponseMessage<String> routeTest(
      @HttpTrigger(name = "req",
                    methods = {HttpMethod.GET},
                    authLevel = AuthorizationLevel.ANONYMOUS,
                    route = "products/{category:alpha}/{id:int}") 
                    HttpRequestMessage<Optional<String>> request,
      @BindingName("category") String category,
      @BindingName("id") int id,
       final ExecutionContext context
  ) {
           ....
           context.getLogger().info("We have " + category + " with id " + id);
           ....
  }

This Javadoc is probably auto-generated from the following link.
Please fix it.

https://github.com/Azure/azure-functions-java-library/blob/dev/src/main/java/com/microsoft/azure/functions/annotation/HttpTrigger.java#L140

Thank you so much @m-moris for reporting the issue. We will work with the doc team to fix it.