Missing Documentation for extractFromRequest

Hello again!

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?

Hi @gerryfletch!

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.

BTW what do you mean by the “Authorization section of the OpenAPI spec”?

@kciesielski Terribly sorry for the slow reply. I totally forgot to get back to this thread.

What I was referring to is, for example, this Authentication section in the Redoc petstore demo: ReDoc Interactive Demo

Turns out it’s just the top-level info/description field with markdown: https://github.com/Redocly/redoc/blob/main/demo/openapi-3-1.yaml#L7-L41

@gerryfletch Could you try Adam’s suggestion with passing a modified endpoint definition to the documentation interpreter?