Closed jaroslavcervenka closed 4 years ago
Hi.
I have a problem with your awesome library. When I'm using routing attribute with a variable which is used by middleware or by service (not in controller action) the generator fails with "Null reference exception" becouse there is neither ParameterInfo nor PropertyInfo in https://github.com/unchase/Unchase.Swashbuckle.AspNetCore.Extensions/blob/ced7630eaa9e094aab42e27edfe12a433273927f/src/Unchase.Swashbuckle.AspNetCore.Extensions/Filters/XEnumNamesParameterFilter.cs#L65
You can try to use routing attribute [Route("{version}")] above controller action. I suggest to adjust a code block in XEnumNamesParameterFilter with:
[Route("{version}")]
var typeInfo = context.ParameterInfo?.ParameterType ?? context.PropertyInfo?.PropertyType; if (typeInfo == null) { return; }
Thanks and regards. Jarek
@jaroslavcervenka The bug was fixed in the last release. Thanks for the report.
Hi.
I have a problem with your awesome library. When I'm using routing attribute with a variable which is used by middleware or by service (not in controller action) the generator fails with "Null reference exception" becouse there is neither ParameterInfo nor PropertyInfo in https://github.com/unchase/Unchase.Swashbuckle.AspNetCore.Extensions/blob/ced7630eaa9e094aab42e27edfe12a433273927f/src/Unchase.Swashbuckle.AspNetCore.Extensions/Filters/XEnumNamesParameterFilter.cs#L65
You can try to use routing attribute
[Route("{version}")]
above controller action. I suggest to adjust a code block in XEnumNamesParameterFilter with:Thanks and regards. Jarek