ePages-de / restdocs-api-spec

Adds API specification support to Spring REST Docs
MIT License
388 stars 102 forks source link

When i use webtestclient, i am getting on error message 'please use RestDocumentationRequestBuilders with urlTemplate to construct the request' #234

Open JoeyCLO opened 1 year ago

JoeyCLO commented 1 year ago

RestDocumentationRequestBuilders class is only use mockmvc. isn't it? However, when using the webtestclient, you must also use the RestDocumentationRequestBuilders.

Is there any way to solve this problem?

reneschroeder0000 commented 1 year ago

You can use this instead (using the String version of the uri function):

client.get().uri(
    UriComponentsBuilder
        .fromPath(testPath)
        .queryParam("styles", styles)
        .toUriString()
)