Skip to content

No longer able to override the toString() in HandlerMethod from 6.1.3 #32184

@mauriciogeneroso

Description

@mauriciogeneroso

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.

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: regressionA bug that is also a regression

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions