setBasePath method is missing in DocumentBuilder since version 4.0
See original GitHub issueI’m submitting a…
[ ] Regression
[x ] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
The method setBasePath(basePath: string)
is missing in the current (4.0.9) @nestjs/swagger version.
Expected behavior
Have a method to set base path as it was in older versions, for example (3.1.0)
Minimal reproduction of the problem with instructions
const options = new DocumentBuilder()
.setTitle('example')
.setBasePath('/example')
.build();
will result 'Property ‘setBasePath’ does not exist on type ‘DocumentBuilder’
What is the motivation / use case for changing the behavior?
Have the ability to set swagger with base path
Environment
Nest version: Nest version: @nestjs/swagger@4.0.9
For Tooling issues:
- Node version: 12.14.0 (LTS)
- Platform: Mac and Windows
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:6 (2 by maintainers)
Top Results From Across the Web
SetBasePath not present in ConfigurationBuilder under .NET ...
According to the docs for .NET Core 5, there's a method SetBasePath and it's widely used in a bunch of ...
Read more >FileConfigurationExtensions.SetBasePath ... - Microsoft Learn
Sets the FileProvider for file-based providers to a PhysicalFileProvider with the base path.
Read more >XMLConfiguration (Apache Commons Configuration 1.10 API)
If no specific builder has been set, this method returns null. Returns: the DocumentBuilder for loading new documents; Since: 1.2. setDocumentBuilder.
Read more >Index (||Oracle Database XML Java API Reference||)
Creates a new XQItemType object representing the XQuery document-node(elementType) type containing a single schema-element(...) createDocumentType() - Method in ...
Read more >API with NestJS #60. The OpenAPI specification and Swagger
However, since it might be confusing, it is worth outlining the ... The DocumentBuilder class contains a set of methods we can use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@samdidos https://docs.nestjs.com/recipes/swagger#global-prefix
setBasePath
is no longer required (a global path will be populated automatically). If you want to have more control over that, you can useaddServer
.For better developer experience, I’ve added depracated
setBasePath
in 4.1.1 release to inform devs on how to migrate from the previous API.