With the following configuration in my controller, my swagger documentation still shows all Create Update and Delete routes.
CatController.ts
@Crud({
model: {
type: Cat,
},
routes: {
only: ['getOneBase', 'getManyBase']
},
})
model: {
type: Object,
},
is this a real example? I mean do you really use it like that? With Object?
No sorry, that is obviously not the real model type, i'll change my pseudo code
@Jensderond what version of @nestjs/swagger do you use?
P.S.
I've couldn't replicate your bug with the latest swagger package
Hmm maybe this is going beyond just swagger..
target-pipeline.controller.ts
@ApiTags('Target pipeline')
@Crud({
model: {
type: TargetPipeline,
},
routes: {
only: ['getOneBase', 'getManyBase']
},
})
@Controller('target-pipeline')
[Nest] 93076 - 01/27/2020, 15:13:50 [RoutesResolver] TargetPipelineController {/target-pipeline}: +0ms
[Nest] 93076 - 01/27/2020, 15:13:50 [RouterExplorer] Mapped {/:id, GET} route +0ms
[Nest] 93076 - 01/27/2020, 15:13:50 [RouterExplorer] Mapped {/, GET} route +1ms
[Nest] 93076 - 01/27/2020, 15:13:50 [RouterExplorer] Mapped {/, POST} route +0ms
[Nest] 93076 - 01/27/2020, 15:13:50 [RouterExplorer] Mapped {/bulk, POST} route +0ms
[Nest] 93076 - 01/27/2020, 15:13:50 [RouterExplorer] Mapped {/:id, PATCH} route +1ms
[Nest] 93076 - 01/27/2020, 15:13:50 [RouterExplorer] Mapped {/:id, PUT} route +0ms
[Nest] 93076 - 01/27/2020, 15:13:50 [RouterExplorer] Mapped {/:id, DELETE} route +0ms
I'm pretty much sure this functionality works. Could you please provide a GitHub repository that represents this issue so that I could play with it?
Hmm, indeed. While creating a demo repository I cannot reproduce the problem, even when I copy/paste the exact module/controller/services. Closing this for now! Sorry for wasting your time :'(
Removed dist and node_modules folders and the problem is gone 馃憤