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

Generate each service call as a function, and add the option to no longer generate services #282

Closed
luisfpg opened this issue Aug 24, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@luisfpg
Copy link
Contributor

luisfpg commented Aug 24, 2023

For very large APIs, a lot of unused code is generated, because the services have code to handle every request.
So, we'll always generate a function per service operation.
The function will get as parameters:

  • The HttpClient
  • The rootUrl
  • The (possibly optional) operation parameters
  • The optional http context

It will return the Observable as always.

The generated services are refactored to call those functions instead of having the code inline.

As such, no perceptible changes will be introduced to existing generations.

A new option, "services" (which defaults to true) will control whether services should be generated. Setting it to false will only generate the functions, which can be directly imported and used by the application.

@luisfpg luisfpg added the enhancement New feature or request label Aug 24, 2023
FlorianGrimm pushed a commit to FlorianGrimm/ng-openapi-gen that referenced this issue Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant