microsoft / kiota

OpenAPI based HTTP Client code generator
https://aka.ms/kiota/docs
MIT License
2.85k stars 194 forks source link

Kiota Coverage Test Suite #2020

Closed darrelmiller closed 1 year ago

darrelmiller commented 1 year ago

Using the GitHub search mechanism, walk the advertised OpenAPI descriptions, generate clients and compile those clients. We can exclude Microsoft Graph because we already test that elsewhere

Benefits:

darrelmiller commented 1 year ago

Example of code to walk the Apis.guru list https://github.com/microsoft/OpenAPI.NET/blob/vnext/test/Microsoft.OpenApi.SmokeTests/ApiGurus.cs#L41

sebastienlevert commented 1 year ago

Some thoughts on the APIs we should be testing against. Using this https://www.postman.com/explore/most-popular-apis-this-year to identify the most used. I'm linking either the yaml file if available, or the Postman collection, from which we could export the collection and transform it to OpenAPI.

Now, these would be considered as "most popular" but probably not diverse enough to help us identify edge cases. Should we just loop through all of APIs guru catalog and generate every possible clients?

darrelmiller commented 1 year ago

It's what speakeasy did. https://github.com/speakeasy-api/openapi-directory/tree/main/SDKs I have mixed feelings about it.

sebastienlevert commented 1 year ago

I absolutely agree with you. I don't think it's necessarily adding real value... Using the top APIs is certainly a good first step, but I don't feel we will find all the crazy things we can see in an OpenAPI description... @baywet or @RabebOthmani any idea on how we can get a high level of confidence we are generating valid clients with a diverse set of API definitions?

baywet commented 1 year ago

As I've started working on this, I did have a couple of remarks:

Bottom line, starting with 15/20 popular APIs like Seb listed is a good starting place. I do have a couple of remarks on that list:

Early implementations already uncovered a couple of things #2351, #2352, #2353 (and that's without counting the issues I've reported to GitHub directly)

sebastienlevert commented 1 year ago

I agree for Twitter, we might want to hold on it. Though, it's a very popular API so with (or without) the paid APIs, I think it's still relevant from a generation perspective.

For Postman collections, you might be right... It makes 11 OpenAPI descriptions... Any other candidates we want to include?

baywet commented 1 year ago

Adding to the list, a lot of descriptions will fail because of the lack of union/intersection types support in TypeScript (#1812) and other languages.

sebastienlevert commented 1 year ago

Failing now, or failing later? We expect to support these scenarios right?

baywet commented 1 year ago

failing now, union type support was never implement in typescript because that was at the time we rebooted efforts to have a lighter experience in typescript and I wanted to avoid potential conflicts. As per python/php, some of the work is still ongoing. And it remains to be done entirely in Ruby

baywet commented 1 year ago

Note from the meeting:

baywet commented 1 year ago

APIs ignored:

new bugs uncovered

2360, #2361, #2362

baywet commented 1 year ago

additional bugs

2366, #2367, #2368, #2369

sebastienlevert commented 1 year ago

Really happy to see these bugs being caught!

baywet commented 1 year ago

additional issues

2372, #2373, #2374, #2375, #2378