Building Microservices with Go: 8 Auto-generating HTTP clients from Swagger files

  Рет қаралды 27,847

Nic Jackson

Nic Jackson

Күн бұрын

Пікірлер
@tomontheinternet
@tomontheinternet 2 жыл бұрын
This is pretty cool. I'm writing a Go API. I'm using comments to document the API. The comments let me generate a Swagger file. The Swagger file let's me generate a /docs website. The Swagger file also let's me generate a Go client for the API. The Go Client for the API can be used to test the API itself. Wow.
@sbobadilla
@sbobadilla 3 жыл бұрын
long long time after this was posted, but I just have to say that this whole series is truly amazing, and I am absolutely baffled at how you managed to debug the whole thing. When the test passed I literally opened my eyes wide and stared in amazement. And you do make it seem easy, you are a fantastic teacher, and it really shows that you are knowledgeable in the topic you are covering. Thank you for making this series.
@IvanZupancic
@IvanZupancic 4 жыл бұрын
I for one really liked the video. I saw Nic suffer a bit :) On a serious note it is nice to see it's not just re-purposed re-hashed scripted content.
@NicJackson
@NicJackson 4 жыл бұрын
Well debugging that was interesting. I was literally learning all of that as I went, I hope you also find the approach of debugging useful and the thought process I go through as I do this. Debugging is one of the most difficult parts of writing code, much is trial error and intuition. But step debugging in tools like VSCode really help to take the guesswork out.
@dimayasnohurskyi2805
@dimayasnohurskyi2805 4 жыл бұрын
Yup, it's was interesting)
@ramana1729
@ramana1729 2 жыл бұрын
Hi Nic - great job - just enjoyed every bit - yes debugging is a pain but can relate to it. Thanks.
@ramana1729
@ramana1729 2 жыл бұрын
That was great Nic. Very impressed.
@preferablyoutside
@preferablyoutside 3 жыл бұрын
can't overstate just how helpful it was to watch your debugging process - cheers :)
@craigstroberg4136
@craigstroberg4136 3 жыл бұрын
Thank you for adding this video it was informative on how you approached debugging the issue.
@jared6117
@jared6117 Жыл бұрын
learned quite a few useful things about the debugger
@kobe248ryant
@kobe248ryant 3 жыл бұрын
Nice video Nic, unlike most other scripted videos, it shows how you approach the problem and solve it with humanity.
@cortofior
@cortofior Жыл бұрын
Thanks Nic, these videos teach me a lot!
@mohammedbadusha5353
@mohammedbadusha5353 3 жыл бұрын
Hi Nic, I have query regarding how to compile on Makefile on windows . Reason is installed VScode in windows box. Please suggest me,
@khwarzme
@khwarzme 2 жыл бұрын
Are you not using WSL2? There was a video by Nic (not sure if it's part of this playlist or not) in which Nic is setting up his environment for development on windows using WSL
@WrongOrNot
@WrongOrNot 4 жыл бұрын
Great Job :) Thanks for your work! Any chance that you show how you would implement the generated go server-stub? I am trying Swagger right now designed an API and generated the stub. Now im wondering how i can implement that to business logic without modifiing the stub files. I do not want to modify stub files because i think then it is not updateable anymore if the API changes
@szucik1021
@szucik1021 3 жыл бұрын
Wen will the next episode / series?
@abdorootuae
@abdorootuae Жыл бұрын
thank you so much for the useful content
@superchorizo2860
@superchorizo2860 4 жыл бұрын
Does anybody use Swagger Codegen in real projects? Code generation is kind of a broken promise, and I always end up implementing rest clients myself.
@NicJackson
@NicJackson 4 жыл бұрын
Personally I am not a fan, I find the structure of the generated code quite cumbersome to work with. Having said that with gRPC I would happily use the generated clients. I think the key is a that this is possible. Some folks will be quite happy to use an autogenerated client and if you document with Swagger it is pretty trivial for them to do this.
@siddhantsharma5125
@siddhantsharma5125 4 жыл бұрын
@@NicJackson does the quality of documentation that we do end up effecting the generated code?
@eamarc
@eamarc 4 жыл бұрын
I used both generated client: from go-swagger and from swagger editor service, but it was painful. However this clients helps me to find some errors in main code.
@titusdishon5109
@titusdishon5109 4 жыл бұрын
Hey @Nic , I got this error - path param "id" is not present in path "/products" - path param "{id}" has no parameter definition any idea what could be the reason
@NicJackson
@NicJackson 4 жыл бұрын
Hey Titus, was this during generation of the client code?
@titusdishon5109
@titusdishon5109 4 жыл бұрын
@@NicJackson yes, I think it has something to do with the swagger. yaml file
@danchenganga4158
@danchenganga4158 2 жыл бұрын
@@titusdishon5109 latter on in this tutorial we have solved the error by defining the Id in the docs generation
@JoeWaldner
@JoeWaldner 4 жыл бұрын
i cannot seem to get put and post to work. I even got the code from git. Seems like it does not even hit the breakpoints :-(
@NicJackson
@NicJackson 3 жыл бұрын
Joseph is it possible for you to share your code pls, more than happy to look.
@sovrinfo
@sovrinfo Жыл бұрын
Awesome, Big Thanks!
@ultiumlabs4899
@ultiumlabs4899 3 жыл бұрын
love this series. keep going Nic. debugging is important part of programmer's life.. but I just feel get lost following the code, because it seems like you add file, add code & moving the code behind the scene, did I watch by wrong order? I'm watching based on the number Go:7, Go:8, and so on
@khwarzme
@khwarzme 2 жыл бұрын
You did not watch the wrong order. Nic does do changes between series especially when the work is tedious and redundant. I tried to follow up by coding along with him but now i'm using his repo, and I checkout to the series I watch. This makes much more sense and makes my mental effort focused on understanding what he's doing rather than trying to keep up with writing the code
@jsonkody
@jsonkody 4 жыл бұрын
Ooo .. new mic .. rode podmic :D
@cizma27
@cizma27 Жыл бұрын
At around 25:00 it was really painful to watch xD
@AbegazNap
@AbegazNap 11 ай бұрын
nice bit of debugging
@pakpresopus
@pakpresopus 4 жыл бұрын
change the title to "debugging in go" , i got more of a debugging lesson hahaha
@NicJackson
@NicJackson 4 жыл бұрын
This is also kind of the point, nobody writes perfect code and defining is a skill in itself so i try to show that part of the process rather than editing out
@pakpresopus
@pakpresopus 4 жыл бұрын
@@NicJackson oh wow nic himself i like ur lesson nic , is there any plan to make a tutorial on how to implement a database such as mongodb in go?
@NicJackson
@NicJackson 4 жыл бұрын
@@pakpresopus yes, id like to do that. Time is really tough at the moment
@ramiroandresvidela6592
@ramiroandresvidela6592 3 жыл бұрын
Huff that's a real pain!. I Unless we where talking about a really big service, I think is not worth the extra pain to generate this over structure code. Just keep it simple, Create a simple http client, add some of the basic params that you may need and that's all. That is way too much code for too little services. Not for me. I'll stick with the old fashon way. Do it yourself
@kemalkaraduman4108
@kemalkaraduman4108 2 жыл бұрын
Thank you so much broooooooooo!
@developmentapp
@developmentapp Жыл бұрын
Is it cold at your house? Why are you wearing a hat?
@NicJackson
@NicJackson Жыл бұрын
In winter yes. I could heat the whole house just to heat one small room, but that is not really very good for the environment. Thanks for too concern tho
@developmentapp
@developmentapp Жыл бұрын
@@NicJackson смешно
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 45 МЛН
SQLC in Go - Auto-Generating Database Code in Golang
32:02
BugBytes
Рет қаралды 15 М.
Building RPC based Microservices with ConnectRPC in Go
50:30
Nic Jackson
Рет қаралды 2,5 М.
OpenAPI & .NET: You're Doing It Wrong - Mark Rendle - NDC London 2023
1:01:08
Ask Me Anything
2:00:15
Nic Jackson
Рет қаралды 5 М.
Building Microservices with Go: 15. Refactoring Part 1/3
29:50
Nic Jackson
Рет қаралды 9 М.
Using gRPCurl to interact with gRPC services
18:41
Nic Jackson
Рет қаралды 14 М.
Golang Microservices: REST APIs - OpenAPI / Swagger
17:18
Mario Carrion
Рет қаралды 26 М.
Ten Steps to Mastering the Fetch API
2:19:52
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 49 М.
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН