We have an authentication method that is rather complex, and so instead of a bunch of single inputs to form the data we need from the request, we’re using extractFromRequest(identity) with some descriptions and examples.
Although the auth is being used, the generated OpenAPI spec doesn’t seem to include the documentation on the auth. That kind of makes sense, because we’re not providing any fine grained inputs, but it would still be useful to have the descriptions and examples in the Authorization section of the OpenAPI spec. Is there a different way I could define the endpoint to make that happen?
Unfortunately whatever you extractFromRequest, it will not be included in the documentation. Maybe you can describe your authentication logic and examples in the .description of an endpoint? It can be a multiline text with markdown syntax, and it gets rendered pretty well in Swagger. However, the raw OpenAPI YAML doesn’t look good (line breaks are just \ns).
BTW what do you mean by the “Authorization section of the OpenAPI spec”?
As another option, also mentioned here, you can modify the endpoint/endpoints passed to the documentation interpreter with the authentication inputs/outputs, so that you do get at least some documentation, even if the actual logic is somehow more complex.