Closed heanssgen-troy closed 9 months ago
Am I correct that you are expecting the following result:
|===
|Path|Type|Optional|Description
|results.active
|Boolean
|true
|@return the active.
and currently we are omitting results
part incorrectly?
It appears that the autodocs auto-response-fields generator does not properly unwrap nested generic properties, even though the supporting jackson library can. Specifically, the resolver does not unwrap the concrete implementation type, instead preferring the generic base type.
Whats more is that the extracted type changes whether or not you return a reactor type (mono/flux) or a straight response type. If you return a non-reactive type, the PagedRestResponse object is captured in the .adoc. If you instead return a reactive type, the PagedRestResponse is swallowed (leading to an improper rest doc).
The PagedRestResponse object
An excerpt from the default spring-restdocs. As you can see, it has resolved the generic response type just fine.
The autogenerated auto-response-fields adoc. As you can see, it has completely omitted the PagedRestResponse response wrapper
The POJO being resolved by this library
The actual POJO being returned as part of the method (omitted most of it, as its a huge POJO)
The controller method we are calling
The unit test