Swagger: What to use instead of setSchemes in latest NestJs/Swagger

Created on 9 Dec 2019  路  5Comments  路  Source: nestjs/swagger

Im using the latest version of nestjs/Swagger 4.0.9 and see now setSchemes function is deprecated. Please suggest what is the new function to be called instead of setScheme. I coudn't find it anywhere in the nestjs documentation or Internet.

My main use case which was fulfilled by setSchemes function previously was that in local dev environment i using scheme as http and in production i was using https. Please suggest.

Most helpful comment

@vegerot try something like:

new DocumentBuilder()
.addServer('http://')
.addServer('https://')
...

full details here.

All 5 comments

addServer() would solve your issue.

That helps.Thanks

@nartc @amit12cool for a dummy like me how should I use addServer to replicate the behavior of setSchemes('http','https')?

@vegerot try something like:

new DocumentBuilder()
.addServer('http://')
.addServer('https://')
...

full details here.

Thanks, that's what I ended up doing

Was this page helpful?
0 / 5 - 0 ratings

Related issues

patilrevansidh picture patilrevansidh  路  4Comments

ivashog picture ivashog  路  3Comments

ericzon picture ericzon  路  4Comments

djedlajn picture djedlajn  路  4Comments

KatSick picture KatSick  路  3Comments