Closed theHurc closed 7 years ago
Hmm interesting, yeah I can look into that. This raises another question about what to do for async methods like this where you still want to document what the payload should look like. Maybe instead of doing it on a parameter basis we could have an annotation that allows the user to replace the schema for a given response
I'm not sure I follow:
where you still want to document what the payload should look like.
Can you give an example?
I thought if you don't add annotations to the params, they don't show up at all? Am I mistaken?
On Apr 12, 2017 6:00 PM, "Jake Baldwin" notifications@github.com wrote:
I'm not sure I follow:
where you still want to document what the payload should look like.
Can you give an example?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/yahehe/Nancy.Swagger/issues/95#issuecomment-293719970, or mute the thread https://github.com/notifications/unsubscribe-auth/AGqvnalKBq-XqLrjSoPKplzgNO9UQ4rhks5rvUlsgaJpZM4M7_ev .
I'll have to take a more in-depth look at annotations this weekend, I haven't really used it at all since adopting the package
If you don't add annotations to the params they show up with the message "Warning: no annotation found for this parameter" To demonstrate, in the annotation sample project I removed the parameter annotation from the POST /user route and it shows up in the Swagger UI like this:
@yahehe Can you push the latest nuget package so that we can close this issue? (Feel free to wait until the other PR is resolved though)
Pushed
A Nancy route that operates async is defined like this:
Get("/", async (args, ct) => await GetSomethingAsync(args, ct));
Not including
args
didn't seem to work for me. Anyway...When using Nancy.Swagger.Annotations the
args
andct
above show up in the swagger documentation even if they are unused and show up as undocumented. The cancellation token in particular is kind of annoying and clutters things up because it's not actually part of a webapi call, it's a cancellation token used by Nancy to cancel an operation during a disconnection, etc. As far as I could tell it's impossible to set a parameter to ignore. To demonstrate what I mean, if the definition ofGetSomethingAsync
was defined as:That would be cool. Is there a work around for this issue?