Closed arthg closed 6 years ago
@arthg Based on your demo , I find some mistakes !
The namespace of HeartbeatModule should be BillPayApi.Core.Heartbeat !
The wiki page also introduce more details about namespace that you should know .
You miss Response when you use Describe in HeartbeatMetadataModule .
public HeartbeatMetadataModule()
{
Describe["GetHeartbeat"] = description => description.AsSwagger(
with => with.Operation(
op => op.OperationId("GetHeartbeat")
.Tag("Heartbeat")
.Summary("Heartbeat")
//Don't forget Response here!!
.Response(r=>r.Description("desc"))
.Description("This returns status code 200 and some blah blah blah when the service is alive and heart is beating")));
}
Those 2 suggestions got me up and running. Did not notice the namespace issue without the "eyes of Resharper" on my personal machine. Once in the office it becomes obvious. I did not realize the Response was required.
Thank you!
Thanks, @catcherwong for the assistance.
Yeah, the namespace issue is annoying. We should find a way to make it more obvious or maybe document it in the samples too.
And hopefully if there was a problem with Response not being set, the swagger validator would have said something?
Attempting to follow along with the Getting Started wiki, using the builders method, a la the Nancy.Swagger.Demo.
See https://github.com/arthg/BillPay.Core
Expected result: render generated API documentation in Swagger format
Actual result: Swagger chrome is rendered, but "Failed to load spec."