-
Notifications
You must be signed in to change notification settings - Fork 711
NullReferenceException in ApiVersionParameterDescriptionContext.RemoveAllParametersExcept #250
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
Comments
Yep ... except you want to coalesce on the model metadata like so I had new feature I was about to roll out for the API Explorer anyway. I should have this patched and published tonight or tomorrow. Thanks. |
Ah, yes. Thanks for the catch and incorporating the fix. |
Is it possible to backport this bugfix to version 1.0.2 of Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer? |
It's possible, but kind of a pain. Is there a particular reason to not move forward? As an army of one, it's hard to maintain multiple different version branches on 3 difference platforms. This would require creating a divergent branch with the fix or publishing a package version with the fix which doesn't correspond back to source. Neither is very amicable scenario. |
No, there is no particular reason. |
When using the ApiExplorer in AspNet Core a null reference exception is thrown if the API defines a parameter as part of a route, but does not have matching parameter on the controller method.
With no matching C# parameter on GetFoo() the ApiParameterDescription's ModelMetadata is null. A null coalescing operator should fix the problem.
The text was updated successfully, but these errors were encountered: