Hi,
I am trying to use rest-docs / restdocs-api-spec to generate the openapi spec for these two endpoints :

the first endpoint returns a list of Driver and the second one just one driver.
I didn't found yet a way to document that on my unit test.
So, for now, the generated spec contains, in components/schema, a Driver structure and another structure that represents a list of Driver, but on these two structures, the duplication of code is important :


Is there a way to document things so that something like the following will be generated?

Hi,
I am trying to use rest-docs / restdocs-api-spec to generate the openapi spec for these two endpoints :
the first endpoint returns a list of Driver and the second one just one driver.
I didn't found yet a way to document that on my unit test.
So, for now, the generated spec contains, in components/schema, a Driver structure and another structure that represents a list of Driver, but on these two structures, the duplication of code is important :
Is there a way to document things so that something like the following will be generated?