Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Swagger with WCF REST

Tags:

rest

wcf

swagger

I have a WCF REST based service that I would like to add Swagger to. I have installed Swagger.NET package, my project is using .NET 4.0. I have also enabled XML documentation, etc... but now I am not sure the best route from here.

When i launch http://localhost/SwaggerUI/index.html I get the default page with the http://YOUR-URL-HERE:PORT/api/swagger. I am not sure what url should go here. I did enable help of the service via: <standardEndpoint name="" helpEnabled="true" /> which does give me the ugly page here: http://localhost/api/help -- when i plug that into Swagger i just get the result:

200 : OK http://localhost/api/help

What is the best way to proceed, i am not using WebApi but have many of the features available if that helps.

like image 713
schmoopy Avatar asked Jun 12 '13 01:06

schmoopy


People also ask

How do I use REST API with swagger?

Use Swagger Inspector to quickly generate your OAS-based documentation for existing REST APIs by calling each end point and using the associated response to generate OAS-compliant documentation, or string together a series of calls to generate a full OAS document for multiple API endpoints.

Is it possible to use RESTful services using WCF?

You can use WCF to build RESTful services in . NET. REST (Representational State Transfer) is an architecture paradigm that conforms to the REST architecture principles. The REST architecture is based on the concept of resources: It uses resources to represent the state and functionality of an application.

Is swagger JSON auto generated?

Swagger AUTOMATIC Documentation Generation: Just throw a few lines above the resource definition and the documentation (json) is automatically generated by the module.


1 Answers

As of December 2015, there is an implementation of Swagger for Wcf now. You should check this out - Swagger for WCF - SwaggerWcf

like image 80
s4ndhyac Avatar answered Oct 19 '22 07:10

s4ndhyac