swaggerwcf
swaggerwcf copied to clipboard
api-docs is not generated
i have configured as doc but it is not working. What is my wrong? Could you please help me? i did not fix it. You can access ticket from here.
check Step 5 and Step 6 then visit http://localhost/RegistrationService/api-docs/swagger.json if you get json string, go to visit http://localhost/RegistrationService/api-docs/index.html
i checked. everything is the same with doc. when i visit, it redirects me this url. http://localhost/DummyProject/api-docs/index.html?url=/DummyProject/api-docs/swagger.json
protected void Application_Start(object sender, EventArgs e) { RouteTable.Routes.Add(new ServiceRoute("api-docs", new WebServiceHostFactory(), typeof(SwaggerWcfEndpoint))); }
Web Config is
<configuration> <configSections> <section name="swaggerwcf" type="SwaggerWcf.Configuration.SwaggerWcfSection, SwaggerWcf" /> </configSections> <swaggerwcf> <tags> <tag name="LowPerformance" visible="false" /> </tags> <settings> <setting name="InfoDescription" value="Sample Service to test SwaggerWCF" /> <setting name="InfoVersion" value="0.0.1" /> <setting name="InfoTermsOfService" value="Terms of Service" /> <setting name="InfoTitle" value="SampleService" /> <setting name="InfoContactName" value="Abel Silva" /> <setting name="InfoContactUrl" value="http://github.com/abelsilva" /> <setting name="InfoContactEmail" value="[email protected]" /> <setting name="InfoLicenseUrl" value="https://github.com/abelsilva/SwaggerWCF/blob/master/LICENSE" /> <setting name="InfoLicenseName" value="Apache License" /> </settings> </swaggerwcf> <system.webServer> <directoryBrowse enabled="true"/> <modules runAllManagedModulesForAllRequests="true"/> </system.webServer> <system.web> <compilation debug="true" targetFramework="4.6.1"/> <httpRuntime targetFramework="4.6.1"/> </system.web> <system.serviceModel> <services> <service name="SwaggerWcf.SwaggerWcfEndpoint"> <endpoint address="" binding="webHttpBinding" contract="SwaggerWcf.ISwaggerWcfEndpoint"></endpoint> </service> </services> <behaviors> <serviceBehaviors> <behavior name=""> <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="false" /> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> </system.serviceModel> </configuration>
Interface:
` [ServiceContract] public interface IDummyService {
[SwaggerWcfPath("Get Dummy", "Retrieve all dummy from the store")]
[WebInvoke(UriTemplate = "/getdata",
BodyStyle = WebMessageBodyStyle.Bare,
Method = "POST",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json)]
[OperationContract]
void GetData();
}`
Service:
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] [SwaggerWcf("/v1/rest")] public class DummyService : IDummyService { [SwaggerWcfTag("GetData")] [SwaggerWcfResponse(HttpStatusCode.Created, "Data created, value in the response body with id updated")] [SwaggerWcfResponse(HttpStatusCode.BadRequest, "Bad request", true)] [SwaggerWcfResponse(HttpStatusCode.InternalServerError, "Internal error (can be forced using ERROR_500 as book title)", true)] public void GetData() { } }
i create a project with your code, https://github.com/justin0522/swaggerwcf190 it works for me
It is not same as my code. Could you please fix on this project? https://github.com/mustafatig/SwaggerWCFSample
i created a pull request to your project
i create a project with your code, https://github.com/justin0522/swaggerwcf190 it works for me
Hi I'm getting 400 Bad Request
in fiddler when I navigate to the api-docs
URL on my project