How to get Swagger to send api_key in Header and in request URL?
问题 I am able to either get the api key to be represented as a header or as a tag on the end of the url, but I am needing it to be both. Is there anyway for this to be possible? The picture is linked here 回答1: Define both the header and the query parameter in the securityDefinitions section (in OpenAPI 2.0) or the components/securitySchemes section (in OpenAPI 3.0) of your API definition: # swagger: '2.0' securityDefinitions: apiKeyHeader: type: apiKey in: header name: X-EGEN-AccessTokenID