-
Notifications
You must be signed in to change notification settings - Fork 198
Open
Description
Microsoft.Azure.Webjobs.Extensions.OpenApi 1.2.0
.NET Core 3.1
I tried
[OpenApiResponseWithBody(HttpStatusCode.BadRequest, MediaTypeNames.Application.Json, typeof(ValidationResponse))]
but got
Index was outside the bounds of the array.
at Microsoft.Azure.WebJobs.Extensions.OpenApi.Core.Extensions.TypeExtensions.GetOpenApiSubTypeName(Type type, NamingStrategy namingStrategy)
at Microsoft.Azure.WebJobs.Extensions.OpenApi.Core.Extensions.TypeExtensions.GetOpenApiDescription(Type type)
at Microsoft.Azure.WebJobs.Extensions.OpenApi.Core.Extensions.OpenApiResponseWithBodyAttributeExtensions.ToOpenApiResponse(OpenApiResponseWithBodyAttribute attribute, NamingStrategy namingStrategy, VisitorCollection collection, OpenApiVersionType version)
at Microsoft.Azure.WebJobs.Extensions.OpenApi.Core.DocumentHelper.<>c__DisplayClass7_0.<GetOpenApiResponses>b__1(OpenApiResponseWithBodyAttribute p)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Enumerable.ConcatIterator`1.MoveNext()
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector)
at Microsoft.Azure.WebJobs.Extensions.OpenApi.Core.DocumentHelper.GetOpenApiResponses(MethodInfo element, NamingStrategy namingStrategy, VisitorCollection collection, OpenApiVersionType version)
at Microsoft.Azure.WebJobs.Extensions.OpenApi.Document.Build(Assembly assembly, OpenApiVersionType version)
at Microsoft.Azure.WebJobs.Extensions.OpenApi.OpenApiTriggerFunctionProvider.RenderSwaggerDocument(HttpRequest req, String extension, ExecutionContext ctx, ILogger log)
The response type can be as easy as the following, as long as it is a collection.
public class ValidationResponse : List<string>
{
}
When specifying directly it works, however I want to type it.
[OpenApiResponseWithBody(HttpStatusCode.BadRequest, MediaTypeNames.Application.Json, typeof(List<string>))]
taipignas, shembrough, theplankmeister, Epstone, thesushil and 1 more
Metadata
Metadata
Assignees
Labels
No labels