Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return type per HTTP status code? #50

Closed
trydis opened this issue Nov 21, 2016 · 2 comments
Closed

Return type per HTTP status code? #50

trydis opened this issue Nov 21, 2016 · 2 comments

Comments

@trydis
Copy link

trydis commented Nov 21, 2016

[SwaggerWcfResponse(HttpStatusCode.OK, typeof(ClassA)]
[SwaggerWcfResponse(HttpStatusCode.BadRequest, typeof(ClassB)]

Is something similar possible?

@abelsilva
Copy link
Owner

Sure

New release with option for:

        [SwaggerWcfResponse(HttpStatusCode.OK, "Books found, values in the response body", responseTypeOverride: typeof(Book))]
        [SwaggerWcfResponse(HttpStatusCode.NotFound, "Book not found", false, responseTypeOverride: typeof(Book[]))]   

Please note that parameter emptyResponseOverride will have higher priority

@trydis
Copy link
Author

trydis commented Dec 8, 2016

Thanks a lot, just tried it and it works exactly as expected 👍

@trydis trydis closed this as completed Dec 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants