Generating API clients [17 of 18] | Web APIs for Beginners

preview_player
Показать описание

Using the OpenAPI standard, we can do more that just generate documentation and test out our Web APIs. In this video, you will learn how to generate .NET client libraries for your Web API project.

Useful Links

Downloads

#WebAPI #DotNet #ASPNETCore
Рекомендации по теме
Комментарии
Автор

Great tutorials but the last part didn't work for me. It says "Cannot assign void to an implicitly-typed variable" on the line that says "var results = await client.GetRecipesAsync(10);". Any assistance would be greatly appreciated.

darrencole
Автор

I've just moved to having the server side code generated by the OpenAPI generators. Wow, I'll never go back. API first wins every time.

KangoV
Автор

How can we access this web api from class library project, could you please do a video on that? Thank you so much. this is really helpful

saharabdullah
Автор

Hi Cecil. I like the Web API series (18 videos) you created. But, what happens when you need to generate a swagger client and the 3rd party Web API service you are trying to generate a swagger client for is secure ? I did get an initial client secret and client password to generate a token for. I tested it with the ThunderClient add-on under VSCode, and it worked, But the token expires in 1 week, and there is no way I know of to generate a new token.

nelsonrivers
Автор

I should have seen how old this is before watching it.

gregoWahoo
Автор

It would be awesome if that tool generated rest client for odata services at build time without accessing of any running web services.
I have an idea how to do it.
First of all you need edmx model XML.
Using edmx model builder you can provide generating such a model without any running services. This part of servise, so it supposed you are owner of the service.
Then you can build CICD pipeline which generates edmx xml at first step and use than xml for generating swagger rest client at the second step.
The problem is edmx model builder is not accessible without aspnet core environment, so you need provide your own implementation of that part. This is a big deal.

Generating rest client (not odata) at build time is interesting topic as well, but how to provide api metadata generation at build time?

mikhailsidorov