Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional service (naming) generating option #66

Open
arkraft opened this issue Aug 7, 2019 · 2 comments
Open

Additional service (naming) generating option #66

arkraft opened this issue Aug 7, 2019 · 2 comments

Comments

@arkraft
Copy link

arkraft commented Aug 7, 2019

Currently, the names of the services are generated by the path of the request. This could split up services which might belong together. For example, on the server side i have a service for notifications, there are /api/notifications get and put routes, so i will get a notificationService. But i also have a url like this /api/notifications/stream which is used for SSE. This route will create a new folder notifications next to the NotificationService.ts file which contains a StreamService.ts for this subroute. For me, they both belong together on the backend.

I think it would be great, if i could use tags for the service naming. I would then add the notifications tag for all these routes and it will create a notificationsService containing all routes which use the notifications tag. This way i would have more control over the generated api.

I know this is tricky and that the tags field in swagger is an array, this is why i would make it an option where the default is the path version of the service names.

@arkraft arkraft changed the title Additional service (namin) generating option Additional service (naming) generating option Aug 7, 2019
@arkraft
Copy link
Author

arkraft commented Aug 7, 2019

While answering one question from another ticket, i reallized that this might help:

swagger-axios-codegen generates separated service which are not based on the path. I don't know how they actually determine what belongs into a service, my guess is, they use the tags of the routes.

Hope it helps you understand what i mean by this

@ffflorian
Copy link
Member

Hi @arkraft, that's an interesting idea. I think tags would be the only way to solve that though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants