Will OperationDefaultValues still be required in .NET 9.0? #57837
-
I'm analyzing the OpenApiOptionsExtensions.cs file from release/9.0 branch of eShop. In particular, I see the ApplyOperationDefaultValues method, that is similar to the one that was typically used with Swashbuckle.AspNetCore: public static OpenApiOptions ApplyOperationDefaultValues(this OpenApiOptions options)
{
options.AddOperationTransformer((operation, context, cancellationToken) =>
{
var apiDescription = context.Description;
operation.Deprecated |= apiDescription.IsDeprecated();
// remove any assumed media types not present in the api description
foreach (var responseType in context.Description.SupportedResponseTypes)
{ I'm wondering if something like this |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@marcominerva Thanks for reminding me that I actually need to make some updates to this branch before we merge. We shouldn't be using the The other workarounds that are used here can be removed. I'll update the branch. |
Beta Was this translation helpful? Give feedback.
@marcominerva Thanks for reminding me that I actually need to make some updates to this branch before we merge. We shouldn't be using the
ApplyOperationDefaultValues
as is in this example. The only behavior that we need to retain is support for setting theDeprecated
property based on theIsDeprecated
method. That's because we don't really have a good strategy for documenting deprecation status in ApiExplorer yet. An issue was recently opened about this in the dotnet/aspnetcore repo that covers what we might need to do to be able to get rid of this workaround. See #57853 for more info.The other workarounds that are used here can be removed. I'll update the branch.