【发布时间】:2021-07-14 18:54:05
【问题描述】:
我是swagger新手,使用express swagger generator节点模块制作API文档。
API 使用基于字符串的密钥系统,而不是 APIkey。
我用来生成文档的代码如下所示。
/**
* Return merged data for a given landingPageId.
* @route GET /merged/admin/{landingId}
* @group Admin - Admin oriented operations
* @param {string} landingId.path - ID of the needed landing page
* @param {string} auth.header.required - Auth Key
* @returns {object} 200 - Content of a landing page of the specified id
* @returns {object} 401 - Unauthorized
* @returns {Error} default - error
*/
问题是:我不能使用 swagger 的身份验证,因为我没有使用 APIKey,我想通过 express swagger 在 header 中输入我的自定义身份验证,但是“auth.header”不起作用,有没有办法度过这个难关?还是我需要自己去 Swagger 才能找到合适的解决方案?
非常感谢!
【问题讨论】:
标签: javascript api express authentication swagger