I updated Swashbuckle v5 and operation.Parameters() is not valid anymore.Is there any replacement?
{
var apiDescription = context.ApiDescription;
operation.Deprecated |= apiDescription.IsDeprecated();
if (operation.Parameters == null)
{
return;
}
// REF: https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/412
// REF: https://github.com/domaindrivendev/Swashbuckle.AspNetCore/pull/413
foreach (var parameter in operation.Parameters<NonBodyParameter>())
{
var description = apiDescription.ParameterDescriptions.First(p => p.Name == parameter.Name);
if (parameter.Description == null)
{
parameter.Description = description.ModelMetadata?.Description;
}
if (parameter.Default == null)
{
parameter.Default = description.DefaultValue;
}
parameter.Required |= description.IsRequired;
}
}
Error CS0307 The property 'OpenApiOperation.Parameters' cannot be used with type arguments
From Swashbuckle.AspNetCore GitHub site
In OpenAPI v3, body parameters are split out into a separate property called RequestBody. So, I think you may be able to remove OfType filter entirely as all values in the collection are "non-body"
I think you should be able to use OpenApiParameter
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With