rbeauchamp / Swashbuckle.OData

Extends Swashbuckle with OData v4 support!
Other
129 stars 96 forks source link

Throw descriptive exception, missing ResolveConflictingActions (VS2015) #171

Closed eloekset closed 4 years ago

eloekset commented 6 years ago

Same as #170 but using a syntax that is supported by the build server. (#170 should be closed if this one gets merged and vice versa.)

When ResolveConflictingActions is not configured and an OData controller has more than one Get method, an InvalidOperationException with message ResolveConflictingActions is not configured for Swagger is thrown instead of a cryptic NullReferenceException. Gives me a hint on how to solve issue #158 in my project.

rbeauchamp commented 6 years ago

Hi @eloekset, Thanks for working on this! Would you mind adding a unit test that reproduces the issue and demonstrates that it's been fixed? Thanks!

eloekset commented 6 years ago

This happened: https://twitter.com/eloekset/status/927636739530874882 😄 And then I've been kind of busy the last couple of days, but I'll add a test ASAP.

rbeauchamp commented 6 years ago

Wow, you even recorded it on Twitter! 😉 Okay, I'll be away next week on vacation, but if you get them completed by tomorrow, Sunday morning, I'll merge your PR and publish NuGet packages before I go. Thank you!

eloekset commented 6 years ago

It's a bit difficult, because the Unit Test configuration makes the problem not appear. So I try to make a test that doesn't use the default unit test configuration, but then there's a problem with the AccountsController in the tests project, which has a method that's not a valid OData path.

image

So I guess I'll have to exclude that controller somehow without using the default Unit Test configuration.