Affects: 6.1.3


Spring actuator has a WebMvcEndpointHandlerMethod that extends and overrides the toString() from HandlerMethod here.

After the change made on the issue #32007, (this commit), the toString() is no longer used because the HandlerMethod is wrapped into another instance of HandlerMethod, In this block of code:

  // Enable method validation, if applicable
  handlerMethod = handlerMethod.createWithValidateFlags();

And this one:

  /**
  * Re-create the HandlerMethod and initialise
  * {@link #shouldValidateArguments()} and {@link #shouldValidateReturnValue()}.
  * @since 6.1.3
  */
  public HandlerMethod createWithValidateFlags() {
     return new HandlerMethod(this, null, true);
  }

So, I found the issue because in spring-open-api it is no longer able to generate the correct name of the endpoints from actuator /health, /info, /metrics, etc.. due to code is calling the wrong toString() method.

Expected

The field validations implemented in the issue #32007 should not force the override of the toString() wrapping its subclasses back into HandlerMethod.

Comment From: jhoeller

We could preserve the overridden toString result in the HandlerMethod copy constructor, setting the new description to handlerMethod.toString() instead of handlerMethod.description. I'll change this for the upcoming 6.1.4 snapshot, feel free to give it a try: https://ci.spring.io/teams/spring-framework/pipelines/spring-framework-6.1.x/jobs/build/builds/1383

Comment From: mauriciogeneroso

@jhoeller tested with 6.1.4-SNAPSHOT and it is fixed.

I'll wait for the release. Thank you for fixing it.

Comment From: jhoeller

Thanks for double-checking!