pathParameters documentation exception (urlTemplate not found)

The exception message is trying to point you in the right direction:

urlTemplate not found. Did you use RestDocumentationRequestBuilders to build the request?

You need to use RestDocumentationRequestBuilders so that Spring REST Docs can capture the URL and extract the parameters from it. This is mentioned in the documentation where it says:

To make the path parameters available for documentation, the request must be built using one of the methods on RestDocumentationRequestBuilders rather than MockMvcRequestBuilders.

Replacing your static import of MockMvcRequestBuilders.get with one for RestDocumentationRequestBuilders.get should resolve the problem.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)