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

When deriving from SwaggerResponseAttribute only the first applied is used #121

Closed
leppie opened this issue Jul 11, 2016 · 1 comment
Closed

Comments

@leppie
Copy link

leppie commented Jul 11, 2016

Say I do this:

public class SwaggerErrorResponseAttribute : SwaggerResponseAttribute
{
    public SwaggerErrorResponseAttribute(HttpStatusCode code) : 
       base(code, type: typeof(Error))
    {
    }
}

Then apply that on class or method level, then the UI only shows the first one and that response is not present in swagger.json either.

@leppie
Copy link
Author

leppie commented Jul 12, 2016

.NET bug, reported (and PR submitted): dotnet/coreclr#6240

For a workaround: Just implement GetHashCode and, if needed, Equals to desired behavior.

@leppie leppie closed this as completed Jul 12, 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

1 participant