typescript-generator icon indicating copy to clipboard operation
typescript-generator copied to clipboard

Generating one rest class per spring rest controller ?

Open gordon00 opened this issue 2 years ago • 2 comments

Hello @vojtechhabarta,

I already used your generator for a small project. I am thankful for your work. But i would like to use it for a bigger project. (And the code is a mess.) I just would like to know if it is possible to generate one rest client class per spring controller or at least to group some of them ? (to avoid method name collision)

Thanks

gordon00 avatar Dec 22 '21 10:12 gordon00

Hello,

it is still not possible (nor planned) to split output into different files. But it is possible to use restNamespacing parameter to generate one client per one controller or to group rest methods from logical set of controllers (annotated by annotation set using restNamespacingAnnotation) into one client.

vojtechhabarta avatar Jan 30 '22 19:01 vojtechhabarta

I would be so nice to have each type in its own file. I want to annotate the methods with a decorator, so that they can be introspected by the swagger plugin to generate my swagger schema. It works as long as there are not too many types. But if you reach a certain limit, especially if the types have circular relations (like a Person has a Company, but also a PermissionGroup who also belongs to a company). In this case the typescript compiled doesn't know how to resolve this. It would be possible if it wasn't all just in one big file.

mojo2012 avatar May 02 '22 17:05 mojo2012