API development inside a visual studio keeps getting
better and better and better.
It has never been easier to explore and even test out your APIs
with single clicks and beautiful explorers inside a visual studio.
I'm gonna break down the newest and latest features in this video, so tune in.
Hey everyone.
It's James, and yes, I'm back with another API development
video here on my YouTube channel.
And honestly, visual Studio just keeps getting better and better and better.
I started off talking about how you can scaffold out APIs with single
button clicks generate EF Core.
Publish it up to Azure, connect it to databases, do migrations, all
this stuff in just a few clicks.
I then talked about dev tunnels, one of my favorite features.
That puts your local host up onto the web so you can easily debug it in
things like mobile applications or while you're working on a web project, you
can actually share that in progress from your machine to anywhere, which is cool.
And then I just talked about the new at TB file support inside of Visual Studio 2022.
And.
Wow.
The team just keeps making more and more amazing features, and specifically
they have a new endpoint explorer.
In fact, you were asking about it in the comments and then the team did it.
It's amazing.
I have no idea if they're watching the comments or doing Wapa say's,
been down there, and it's really cool to see this feature come into play
because it brings it all together to all the things that we've been
talking about here on the channel.
So let's go ahead and jack it out.
All right, I'm over here inside a Visual Studio 2022.
I have the latest preview install.
This is Let me go to Tools about Visual Studio 17 six, preview six.
Many of the features that I've talked about previously are
now in 17 five General, but this one is the latest preview.
So you might have 17 six GA or the next preview.
So obviously check the show notes below for what version you need for this stuff.
But this is what I'm on today for the new.
Endpoint Explorer.
Okay, so I have my monkey api, which is up on GitHub, which I will put
in the show notes of course below.
And I have a few endpoints.
I have some minimal APIs for our monkeys down here.
So I have this monkey get, uh, groupings, uh, put all this other
stuff that I've talked about.
Over here we have a new continent controller.
So I decided to show off at, hey, all this stuff also works
with traditional controllers too.
So here's an API controller.
Uh, this is a simple, you know, http get sets.
I scaffolded this all out inside of Visual Studio.
All I did was right, clicked.
I said, add new scaffolded item and you can decide what you want.
This one here, API controller or minimal APIs there.
All right, so.
We've looked a lot here.
If I hit debug, I can go down into dev tunnels, I can create a new
tunnel, which we've seen before.
So lots of cool stuff there.
Um, the new thing though that I want to show you is if you go into tools,
options, and again, this may already be generally available by the time
you watch this video, so if it's not in the preview features, it's
okay if you just type an endpoint.
Go to preview features.
You'll see web API endpoints.
Explorer.
For me, this was checked by default.
All right?
Um, so that was really, really cool.
Um, it might need to be checked.
Uh, if you, if it's not checked for you, doubly check it out.
Um, so double check that.
If it's not there, you're probably on the, the release version.
It's probably there by default and you can check it because
we wanna check out these APIs.
So normally you'd hit diba, go into swagger, do all this stuff.
But I like to have everything integrated, test everything out, uh, inside this api.
So here's what I'm gonna do is I'm gonna pull this a little
bit over so we can see it.
I'm gonna go to view, um, other Windows.
Oh, one more time.
Pull way over cuz I'm on this ultra wide screen.
So view other Windows and right here, endpoint Explorer.
Boom.
Amazing.
So what this does, let me go ahead and put this here, is it will
show me all of my APIs inside.
Of my project over here.
All right.
And I can pin that here, so that's really nice.
I can see everything in real time.
I can, go ahead.
Let me zoom in over here and see that I have some gets, I have the monkey APIs.
I have this new continents API here.
So one of the controllers, if I drop this down, we can see
that there is no controller.
The method here is Matton endpoints.
It's in this file path.
It's kind as minimal.
They go over into get continents.
Uh, here we can say this one has a specific controller.
Uh, they get continent method and then it is a kind of attribute.
I can right click on any of these.
This is where it gets really cool, and I can go ahead and say, oh,
open an editor and it'll open up my code automatically to it.
So here's the, the, the n monkey endpoints, and here it is, the map Get.
So now I can close this down, which is nice.
Now here's where it gets even better, as I have all my endpoints that I
can explore, easily do see what's in in here, which is cool, right?
Lemme just go ahead and run this.
All right.
So I run it, of course I get my swagger ui, so it's kind of nice.
I kinda like match up colors.
I like that a lot.
Now for me, I'm just gonna go ahead and minimize this down.
And my, my app is running, so if I go in, I might wanna test this out.
So previously we'd have to go in, add an H C T B file, do a bunch
of stuff, not anymore, right?
Click generate request.
Boom.
It automatically creates a http file for me.
We can see here it's actually mapping a variable for the host address, which
is probably what you'd want to use.
You can put any type of different variable in there and then it's gonna call this API
and even uses these three um, uh, pounds here to separate if I do more methods.
So I'm just gonna hit go.
There we go.
And what we can see is that now I get all my return values over here.
Let's say I wanna do a get, I say generate request.
I have my ID here.
Let's just do monkey two, and I'm just gonna hit go and boom, I get monkey two.
So that's pretty cool.
Now, let's check out continents, right?
So I'm gonna go in.
I'm gonna do generate continents.
Hit go.
I don't have any continents over there, so let's create one.
On my post.
I'm gonna right click generate requests, and this is really neat.
What it's done is it's gone in and said, well, this is a post, and we
know that by the properties that it's content type application, j s json.
If I needed to, I could come in.
Right, and I could go and do accepts in code, cash control authorization,
uh, dates, uh, hosts, ifs, all these different things that are inside
of here, which are really cool.
But this is just gonna take the application here, or
the application, J s o N.
So I'm just gonna do a name and I'm gonna do North America.
There we go.
And now I can run it.
And there we go.
We can see that we have ID two coming in cause I tested it earlier.
North America.
If I go back into my get, there we go.
We get an array back of this back.
Now I can also do, you had guessed it right, I could do a delete.
So generate request and sure enough I have the request here and now I can do two.
I'm gonna go ahead and boom, hit it.
Successful, no content coming back.
Go ahead and test this back up.
And just like that, I have everything in line.
Now the cool part here is that you can then check this
into source control, right?
And then of course, you are easily creating this so you
can share it between your team.
If you're creating libraries, you can easily go ahead and share that
with the world and show how easy it is to go ahead and map those out.
This is really cool.
I like that it automatically does everything for you right there.
Now I gotta point out that over here.
On the Visual Studio blog, Saed did an amazing, mind boggling,
amazing blog post on all of the new features inside of Visual Studio
2222 that you can take advantage of.
And many of 'em here.
I've covered on this now that I've done the Endpoint Explorers, but there's tons
of videos on the Visual Studio, YouTube.
He walks through everything that you could possibly wanna know in scaffolding
this out and specifically, If we go down further, we can see that he
talks about the new Endpoint Explorer.
So I'll link to this blog post, show everything here.
He has a full API here, which is really, really cool.
Shows everything off all the mappings here.
Now I wanna point out that many of you asked a lot of questions and Ed's
been awesome and answering them on, uh, my YouTube on the Visual Studio
YouTube on on the blog as well.
He talks about some of the things that are gonna be supported in the future
and what aren't supported today.
So the first thing, as you go down here, He talks about variables, request lines,
all of these things that you can put in there, different headers, so cash control,
accept in here, all these great things.
And right now there's a bunch of things that aren't supported out of the
hood, uh, out of the box I should say.
Now many of these, um, are, are very familiar features of the Visual
Studio Code extension over here.
Um, um, that has been available.
Many of you mentioned it, like, Hey, this is here and this is where
the sort of visual studio, uh, uh, integration was inspired by.
And there's many features here.
That aren't yet supported over in the Visual Studio HTTP editor.
So as Knight says, the same file format that's supported in both Visual Studio
and if you happen to be used Visual Studio Code, you can use those same exact files.
So that's really nice, but he mentions what's coming next, so being able
to stub out the body for the request more syntax support and few view
request history, all that stuff.
Let him know what you think.
Put it down there, check it out.
I'll put links to this blog post to the rest client for VS.
Code and of course to my other videos as well.
All right.
What do you think if you're using Visual Studio or vs code,
what extensions are you using?
Do you want other features or what do you need supported?
Write down in the comments below.
Would love to know.
And of course I'll ping my Maiman Saad, who's been working on all
these features over at Microsoft.
Um, because I love just how things are super integrated,
super great inside of the ide.
I love it all in one.
It's nice to have all these other.
Back points, right?
I love my Swagger ui, I love Postman.
Different scenarios, different types of things, but I really
like this full solution, that integrated development environment.
Mm, so good.
All right, well if you made this one on the video, be sure to give
it a thumbs up if you liked it, and jam that subscribe button as well.
Appreciate it again, and of course, I need to make a whole playlist.
That's what I'll do for API development and Visual Studio.
I hope you enjoyed it.
Have a great.