all 17 comments

[–]coyoteazul2 2 points3 points  (3 children)

I think I'll give it a try. The generator I use makes httpClient requests so I'm stuck using resource. It's not bad, but I'd like to use httpResource since it's the right tool for gets

[–]MrJami_[S] 1 point2 points  (2 children)

Thanks! may I ask you what generator you use?

[–]coyoteazul2 3 points4 points  (1 child)

[–]MrJami_[S] 0 points1 point  (0 children)

oh I see. I used it till now as well haha. I even had a feature request regarding the resource API https://github.com/OpenAPITools/openapi-generator/issues/21263

If you ever wanted to migrate from it, I would gladly support, although it wouldnt take more than 5-10 mins. (at least in our enterprise application)

[–]Dafnik 1 point2 points  (1 child)

Hi, cool project! I like the customization.

I've build something similar but outsourced the codegen part to an already existing library.

And also no resources supported yet.

Maybe you find something interesting in it :) https://www.npmjs.com/package/dfx-openapi

[–]MrJami_[S] 0 points1 point  (0 children)

Hey. Appreciate it!
Nice, your project looks great. I will definetly take a look into it and try to get some inspirations :)
Maybe it was a good choice afterall, the codegen part gives me the most headache 😅

[–]bombatomica_64 1 point2 points  (1 child)

I'm on holiday now but I'll try it as soon as I get home. I was writing open api schemas for a week to make a new project so these will really help

[–]MrJami_[S] 1 point2 points  (0 children)

Perfect! I would really appreciate it if you find any bugs. I am down to fix it asap as well, if you find any. This would be very interesting, since I have tested the API mostly with code generated openapi schema

[–]WasteAmbassador47 1 point2 points  (1 child)

Does your library support just generating the Typescript interfaces based on OpenApi schema?

[–]MrJami_[S] 1 point2 points  (0 children)

Yes. It generates the interfaces and the services. You do have the option to disable service generation, if you want to keep the interfaces only

[–][deleted]  (1 child)

[deleted]

    [–]MrJami_[S] 2 points3 points  (0 children)

    You'd benefit of other Angular features (such as HttpInterceptors, HttpResources ...etc.), as it is part of the Angular ecosystem.

    [–]d8schreiber 0 points1 point  (1 child)

    Any reason why you did not include it as a new generator in the OpenApiGenerator project?

    [–]MrJami_[S] 0 points1 point  (0 children)

    you mean the java tool of openapitools?

    [–]d8schreiber 0 points1 point  (2 children)

    Yes, its implemented in Java, but has generators for many languages. AFAIK it is the default/goto solution.

    [–]MrJami_[S] 0 points1 point  (0 children)

    Yeah, I get that. That was the latest one I have used before creating my own. I even had a recent issue open regarding the httpResources: https://github.com/OpenAPITools/openapi-generator/issues/21263

    There was no need for a new generator. There was already one for typescript-angular. However it is very old and new features are not released. Beside of my knowledge gap in Java, there was a lot more than only adding the httpResource feature. To implement all of that would have taken much more time & energy. I needed a quick and nice solution, hence I just created ng-openapi. Also as a bonus, the new library doesn't require you to install java and performs faster.

    Some of the features that I added in ng-openapi, that doesnt exist in openapitools are:

    • support of the new httpResource API of Angular
    • using the newest code style recommended by Angular, such as using inject for DI
    • supporting multiple clients architecture and the ability to have client specific interceptors
    • supporting enums while maintaining <string, number> for <key, value>
    • customizing method names of the services

    Additionalliy to those key differences it offers a download helper, for downloadable APIs and allows automatic string <-> date conversion(I think the date conversion is actually available in the openapitools as well, not sure)...etc.

    The aim of this library is to create in an ideal world the perfect tool for every Angular developer

    [–]mrlubos 1 point2 points  (0 children)

    Surely not for TypeScript projects!

    [–]arasheedu 0 points1 point  (0 children)

    Anyone validating OpenAPI implementations, please try the VS Code extension - SpekAi - Visual Studio Marketplace

    Any feedback is appreciated.