Generate OpenApi (Swagger) Angular client API library & stop maintaining APIs in your Angular app!
Vložit
- čas přidán 11. 09. 2024
- Learn how to leverage the power of OpenApi Codegen to generate Angular client API library and how to use that library in your Angular app.
Stop wasting hours in maintaining API code in the Angular app and dealing with object mappings and bug-prone development.
This video focuses on Angular client but there are dozens of languages/frameworks that OpenApi Codegen supports.
Please Like this video and Subscribe to my channel in order to support me in creating more tutorials like this.
Please feel free to comment on the video if you have any questions, or if you'd like me to do a tutorial on anything.
Helpful Links:
Swagger / OpenApi Docs: swagger.io/doc...
OpenApi CodeGen setup: github.com/Ope...
GitHub Repo: github.com/tec... (Branch: tutorial-openapi)
Nx (Nrwl) : nx.dev/l/a/get...
Thanks for the useful video. There are not so many videos on CZcams about OpenAPI. So this is the brilliant one!
Glad I could help. Thanks for watching!
Excellent explanation, there is almost nothing explaining openapi and Angular. Thanks for your contribution.
I'm glad I could help. :)
Please feel free to post suggestions for topics you'd like to see on this channel.
Happy coding!
This is amazing tutorial to start with openapi client in angular, thanks :)
I'm glad I could help. :)
Hands down best video on this subject all these other videos of annoying nerds posting things we not interested in i dont wanna install 1000 other dependencies / tools for a code gen.
Thanks a lot! I'm glad you found it useful.
thanks for the great video. any idea if this also works with angular standalone components (where we dont have app.module.ts). I am struggling about how to plug it in in this scenario.
thanks for your contribute very much
No problem. Thanks for watching!
god will bless you this really help me alot today
I'm glad I was able to help. Happy coding! 🙂
thank you for this video , i suscribed you for future tutorial ... good luck
Thank you!
Great Video✌
Thank you and thanks for watching!
Hi Sahaj,
Great video! Thanks for sharing it.
I have a question.
What if I have more than one client? In a microservice project, we have different clients for the different microservices. I see that the instance of the ConfigurationParams is coming from a specific client that you built. How I can pass the same configuration to all clients instead of repeating the same code N times using the objects from each client?
hello, I want to use the open API, but my project is in QT, if I just use the .yaml file in my project without the settings you made in libs/openapi will it work? or it only works with settings made in libs/openapi???????
URGENT
Ideally it should work but you may need some configurational settings specific to QT. I havent really worked with QT so I can't be sure.
Error: 'java' is not recognized as an internal or external command
Thanks a lot!
Glad I could help!
awesome!
I'm glad I could help. :)
Please feel free to post suggestions for topics you'd like to see on this channel.
Happy coding!
I m trying to see if I can generate the angular code from swagger without dropping sonar cube analysis
I'm not sure why you would need to drop sonarcube analysis. The analysis should work on any code.
best
I'm glad I could help. :)
Please feel free to post suggestions for topics you'd like to see on this channel.
Happy coding!
Great tutorial, thank you for your effort. I have a question about implementing micro services backend architecture, how do you implement and generate multiple swagger spec jsons when you a separate swagger for each of them?
Thank you!
I recommend using Nx to maintain a monorepo. Every microservice can have its own swagger spec file. The file can either live somewhere in the microservice directory itself, or you can have a separate folder in the monorepo and call it swagger, and place all spec files there.
You can then leverage Nx to have a command in your microservice's workspace.json, that would generate the swagger library using the respective microservice swagger spec file. The command would basically call a script that would find the associated swagger spec file for the microservice (have a naming convention) and run the respective codegen command to generate the client library for the microservice.
@@techtacious This was what i was looking for... Thanks!
Thank you...really appreciate it. How would I have my .NET core api generate a yaml file from an API I already have?
No worries, thanks for watching!
I have never worked with .NET but I'm sure there would be documentation regarding this on Openapi / Swagger's website.
please increase font size in your screen :(
Hi Hadi! Apologies for the small font size. I am aware of the problem and I will take care of it in my future videos. Thanks for your comment!