gid-oss / dataui-nestjs-crud

NestJs CRUD for RESTful APIs
https://github.com/nestjsx/crud/wiki
MIT License
124 stars 32 forks source link

export helpers and expose crudSwagger decorator #56

Closed its-dibo closed 3 months ago

its-dibo commented 4 months ago

export helper files in index.ts, so we can create a custom decorator to add Swagger props to custom routes.

also, this package can expose CrudSwagger() decorator to add similar swagger props to that used by @Crud()

usage:

@Crud(...)
export class MyController implements implements CrudController<MyEntity>{

@Get("me")
@CrudSwagger()
customRoute(){
 return this.service.getUserInfo()
}

}
zaro commented 3 months ago

@its-dibo I don't quite get why do you need both. The idea of exposing the internals of crud is to be able to implement the CrudSwagger() decorator outside of the package, right ?

Anyway, I don't have the time now to implement this decorator, but would definitely help if someone takes on it.

its-dibo commented 3 months ago

ok, as a first step we'll just export the helpers so others can implement their own decorators. a next step is to provide a ready-made functionality that can be used directly.