@midwayjs/swagger 3.20.6-beta.2 → 3.20.6-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { SecurityRequirementObject } from '../interfaces';
|
|
2
2
|
export declare function ApiSecurity(name: string | SecurityRequirementObject, requirements?: string[]): ClassDecorator;
|
|
3
|
-
export declare function ApiExcludeSecurity(): MethodDecorator;
|
|
3
|
+
export declare function ApiExcludeSecurity(): ClassDecorator & MethodDecorator;
|
|
4
4
|
//# sourceMappingURL=api-security.decorator.d.ts.map
|
package/dist/swaggerExplorer.js
CHANGED
|
@@ -221,9 +221,10 @@ let SwaggerExplorer = class SwaggerExplorer {
|
|
|
221
221
|
Object.assign(paths[url][webRouter.requestMethod], e.metadata);
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
224
|
+
// 检查类和方法上的 ApiExcludeSecurity
|
|
225
|
+
const excludeSecurityClass = metaForClass.find(item => item.key === constants_1.DECORATORS.API_EXCLUDE_SECURITY);
|
|
226
|
+
const excludeSecurityMethod = metaForMethods.find(item => item.key === constants_1.DECORATORS.API_EXCLUDE_SECURITY);
|
|
227
|
+
const excludeSecurity = excludeSecurityClass || excludeSecurityMethod;
|
|
227
228
|
// 如果存在安全信息,则将其添加到路径中
|
|
228
229
|
if (excludeSecurity) {
|
|
229
230
|
// 显式设置为空数组,覆盖全局 security
|