ojoanalogo / nestjs-redoc

📘 ReDoc frontend for you NestJS swagger API documentation
MIT License
146 stars 55 forks source link

Could not run redoc in local project - sandbox is empty #4

Closed johnico closed 4 years ago

johnico commented 5 years ago

Hi , first of all thank you for a nice repo

I trying to implemnt in my project and I got page with lot of errors, i cant add data . the sandbox is empty ..etc

my code controller :

 @ApiOperation({ title: 'create a token' })
  @ApiImplicitHeader({ name: 'Autherization' })
  @UseGuards(AuthGuard)
  @Get('token')
  @ApiResponse({ status: 201, description: 'The record has been successfully created.'})
  @ApiResponse({ status: 403, description: 'Forbidden.'})
  public async getToken(@Request() request: TokenRequest) {
    try {
      return this.authService.createToken(request.credentials);
    } catch (e) {
      throw new UnauthorizedException();
    }
  }

main.ts

const options = new DocumentBuilder()
  .setTitle('app title')
  .setDescription('apii')
  .setVersion('1.0')
  .build();

const redocOptions: RedocOptions = {
    title: 'Hello Nest',
    logo: {
      url: 'https://redocly.github.io/redoc/petstore-logo.png',
      backgroundColor: '#F0F0F0',
      altText: 'PetStore logo'
    },
    sortPropsAlphabetically: true,
    hideDownloadButton: false,
    hideHostname: false
  };

const document = SwaggerModule.createDocument(app, options);
//SwaggerModule.setup('api', app, document);
await RedocModule.setup('/docs', app, document, redocOptions);  
ojoanalogo commented 4 years ago

Hi, sorry for the long time, can you try to re run your project with the latest version? there was an issue with dependencies and it should work now with newer versions of nestjs swagger module

ojoanalogo commented 4 years ago

Closed due inactivity