Closed MattoElGato closed 4 months ago
The example isn't wrong because the scheme is used in the random_pet
resource defined below. What you suggest is to add it globally, which is another user case.
This is just an example among many possibilities. A comprehensive coverage of all cases is not something we can reasonably aim at.
Maybe we shouldn't mention security schemes at all at this point of the docs, then.
Closing for now, but thanks for bringing this up in a constructive way.
Hi,
I believe the optional security suite example provided in
apispec/docs/index.rst
requires the linesecurity=[{"ApiKeyAuth": []}]
added at line 37. If you don't add this line then the authorization header isn't added to any requests made from the Swagger UI.Posting here (rather than forking/PR) as I'm not sure if there's a more elegant way of achieving this as part of the block at lines 51-53, but the above is functional.