Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrate swashbuckle swagger with odata in ASP.Net Core [closed]

I have tried to implement both ( swagger and odata ) in asp.net core, but it's not working.

I'm unable to integrate the route given for odata.

I have the following Configuration and I receive a generic error.

Configuration

This is the error

this is the error

like image 777
Ayushi Sharma Avatar asked Jun 20 '18 05:06

Ayushi Sharma


1 Answers

You can integrate Swagger a couple of different ways. For barebones support, you can use the ODataSwaggerConverter provided by OData. This will effectively convert the EDM to a Swagger document. To wire this up to a Swagger generator library like Swashbuckle, you just need create and register a custom generator. The UI and client side of things should remain unchanged. If the generated Swagger document isn't sufficient, the base implementation of the ODataSwaggerConverter is still a reasonable start.

If you're using API Versioning for OData with ASP.NET Core, you need only add the corresponding API Explorer package. Swashuckle will light up with little-to-no additional work on your part. The ASP.NET Core with OData Swagger sample application has an end-to-end working example.

like image 111
Chris Martinez Avatar answered Oct 24 '22 08:10

Chris Martinez