Skip to content
New issue

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

Swagger security #212

Closed
NU-James opened this issue Dec 25, 2022 · 2 comments
Closed

Swagger security #212

NU-James opened this issue Dec 25, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers question Further information is requested

Comments

@NU-James
Copy link

NU-James commented Dec 25, 2022

Feature Request

About api document, authentication is important information.
However, nestia doesn't support it yet.
So please consider to make this feature.

I want to build api docs like below

import { TypedBody, TypedRoute } from '@nestia/core';
import { Controller, UseGuards } from '@nestjs/common';
import { BearerAuthGuard } from '@server/guard/bearer-auth.guard';
import { CreateOnePostDto } from '@server/interface/post/dto/create-one-post.dto';

@Controller('/posts')
export class PostController {
  constructor() {}

  /**
   * 게시글 생성하기
   *
   * @auth bearer => **this is what I want to
   * @param dto 생성할 게시글 정보
   * @returns 생성된 게시글 정보
   */
  @UseGuards(BearerAuthGuard) // =>**auth api require login guard
  @TypedRoute.Post()
  async createOnePost(@TypedBody() dto: CreateOnePostDto) {
    // some logic
  }
}

nestjs/swagger docs
https://docs.nestjs.com/openapi/security

@NU-James NU-James changed the title Need swagger security Swagger security Dec 25, 2022
@samchon
Copy link
Owner

samchon commented Dec 25, 2022

Can you modify the example source code to have import statement?

@samchon samchon self-assigned this Dec 25, 2022
@samchon samchon added enhancement New feature or request good first issue Good for newcomers question Further information is requested labels Dec 25, 2022
@NU-James
Copy link
Author

NU-James commented Dec 25, 2022

@samchon Of course I updated example source code

samchon added a commit that referenced this issue Jan 21, 2023
Close #212 - support swagger security
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants