Open ChrisRichner opened 1 year ago
Can you check latest beta version and updated Readme for minimal API?
@ChrisRichner is this issue still actual?
@petriashev Hi Alexey
I've updated to beta3 and followed the minimal API Docs as close as I could. We do not use minimal API.
The issue still remains for us.
Thank you for your time 👍
Dotnet 8 with Swashbuckle.FluentValidation v 6.0.0 issue still remains and we are seeing this warning:
warn: MicroElements.Swashbuckle.FluentValidation.FluentValidationRules[0] GetValidators for type 'System.ReadOnlySpan'1[System.Byte]' failed System.ArgumentException: GenericArguments[0], 'System.ReadOnlySpan'1[System.Byte]', on 'FluentValidation.IValidator'1[T]' violates the constraint of type 'T'. ---> System.TypeLoadException: GenericArguments[0], 'System.ReadOnlySpan'1[System.Byte]', on 'FluentValidation.IValidator'1[T]' violates the constraint of type parameter 'T'. at System.RuntimeTypeHandle.Instantiate(QCallTypeHandle handle, IntPtr* pInst, Int32 numGenericArgs, ObjectHandleOnStack type) at System.RuntimeTypeHandle.Instantiate(RuntimeType inst) at System.RuntimeType.MakeGenericType(Type[] instantiation) --- End of inner exception stack trace --- at System.RuntimeType.ValidateGenericArguments(MemberInfo definition, RuntimeType[] genericArguments, Exception e) at System.RuntimeType.MakeGenericType(Type[] instantiation) at MicroElements.OpenApi.FluentValidation.ValidatorRegistryExtensions.GetValidators(IServiceProvider serviceProvider, Type modelType, ISchemaGenerationOptions options)+MoveNext() in /home/runner/work/MicroElements.Swashbuckle.FluentValidation/MicroElements.Swashbuckle.FluentValidation/src/MicroElements.OpenApi.FluentValidation/FluentValidation/ValidatorRegistry/ValidatorRegistryExtensions.cs:line 73 at System.Collections.Generic.LargeArrayBuilder'1.AddRange(IEnumerable'1 items) at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable'1 source) at MicroElements.Swashbuckle.FluentValidation.FluentValidationRules.<>c__DisplayClass5_0.<Apply>b__0() in /home/runner/work/MicroElements.Swashbuckle.FluentValidation/MicroElements.Swashbuckle.FluentValidation/src/MicroElements.Swashbuckle.FluentValidation/Swashbuckle/FluentValidationRules.cs:line 77 at MicroElements.OpenApi.Core.Functional.Try[T](Func'1 func) in /home/runner/work/MicroElements.Swashbuckle.FluentValidation/MicroElements.Swashbuckle.FluentValidation/src/MicroElements.OpenApi.FluentValidation/Core/Functional.cs:line 19
Is there any way to make this warning go away? Even if I remove all fluent validation models from the project I am still seeing this.
Hi everybvody! Can you provide any repro for this? I tried to reproduce but could not
I think this happens when you have a ReadOnlySpan in your swagger schema, e.g. as parameter to a method or as a return value.
Hi there
I'm facing the following
System.ArgumentException
when updating my service from.net 6.0
to.net 7.0
. This exception is thrown when the/swagger
site is first accessed.Please let me know if you need further Infos, thanks