We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
koa-swagger-decorator=1.6.8 koa=2.5.1
reproduce:
@tagsAll(["授权"]) @responsesAll({ 400: { description: "参数校验失败" }, }) export default class AuthController { @summary("登录授权") @description("登录授权") @body((LoginParameters as any).swaggerDocument) @request("post", "/api/auth/local") @responses({ // ...commonResponses, 200: { description: "授权成功" }, }) public static async login(ctx) { const data = ctx.validatedBody; ctx.body = await AuthenticateService.authenticate(data); } }
this creates only status code 400 in generated swagger ui but expecting both 400 and 200 responses
workaround:
const commonResponses = { 400: { description: "参数校验失败" }, }; @tagsAll(["授权"]) export default class AuthController { @summary("登录授权") @description("登录授权") @body((LoginParameters as any).swaggerDocument) @request("post", "/api/auth/local") @responses({ ...commonResponses, 200: { description: "授权成功" }, }) public static async login(ctx) { const data = ctx.validatedBody; ctx.body = await AuthenticateService.authenticate(data); } }
Hope this can be resolved in @next milestone #91
The text was updated successfully, but these errors were encountered:
Merge pull request #1 from iamcc/iamcc-fix-95
90692ec
fix Cody2333#95
9c3f42a
Merge pull request #134 from iamcc/develop
b2975dd
fix #95
No branches or pull requests
koa-swagger-decorator=1.6.8
koa=2.5.1
reproduce:
this creates only status code 400 in generated swagger ui but expecting both 400 and 200 responses
workaround:
Hope this can be resolved in @next milestone #91
The text was updated successfully, but these errors were encountered: