cyclosproject / ng-openapi-gen

An OpenAPI 3.0 codegen for Angular
MIT License
403 stars 134 forks source link

Add HttpContext support for Angular 12+ apps. #215

Closed Lonli-Lokli closed 2 years ago

Lonli-Lokli commented 2 years ago

Fixes https://github.com/cyclosproject/ng-openapi-gen/issues/160

Please note that it requires Angular12+

dasMulli commented 2 years ago

@luisfpg is there a team / maintainer opinion on this? It's a change that we'd be interested in upstream (but can still use the templates ourselves using overrides)

luisfpg commented 2 years ago

It is something I'd like to include, but the current problem is the lack of time for the project. The idea is to bump the ng-openapi-gen version to 1.0.0, requiring Angular 12 with this change. For now, I'd say to keep using a template override. The pace of development is slower and slower, as this project has been stable and works for our own usage at Cyclos, and having all the extra stuff is just invested time without really being useful for us.

scurk1415 commented 2 years ago

I think you forgot to import HttpContext in requestBuilder.handlebars

Found this issue when i copied your code for this very useful feature.

Would be really nice if this was merged

Lonli-Lokli commented 2 years ago

@scurk1415 Yep, you are right, thanks. We have a lot more customized templates so missed that when CtrlC+CtrlV. I've pushed fix.

Leonardonline commented 2 years ago

It would be possible to add a configuration parameter to add or not this context in all services?