ASP.NET - How to generate proxy classes from Swagger Restul API

Viewed 5695

In the past I've used Restsharp to consume restul API. RestSharp helps us get concrete type object for given operation. The problem with RestSharp is we need to manually create the POCO classes.

Wondering if we can consume the REST API similar to WCF proxy which generates all operations with signatures and also generates necessary POCO classes.

I tried using Azure API Client and having no luck i.e. not getting strongly typed objects from operation call.

When I directly query the swagger UI I get below:

......,"definitions":{"Object":{"type":"object","properties":{}}}}

I'm quiet new to this Swagger.

  1. Looking at JSON above, should the type and properties be of given type e.g. membership and it's properties?

  2. Am I doing the right tool i.e. azure api client?

Thanks.

1 Answers
Related