You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Based off the discussion here it sounds possible - I haven't been able to find a way to not advertise an API version that is added by namespace convention.
The specific use case is to add a preview API version that only a small number of users would be aware of without advertising it in the header.
The text was updated successfully, but these errors were encountered:
Yes, it's possible. There are a few possible solutions, but the simplest is probably to replace the IReportApiVersions service. The built-in DefaultApiVersionReporter is sealed, but it's still very easy to decorate. You would filter out undesired API versions from the model before they are reported. You can then forward the rest of the logic to the default implementation.
Something like:
sealedclassMyApiVersionReporter(ISunsetPolicyManagersunsetPolicyManager):IReportApiVersions{readonlyDefaultApiVersionReporterinner=new(sunsetPolicyManager);publicApiVersionMappingMapping=>inner.Mapping;publicvoidReport(HttpResponseresponse,ApiVersionModelapiVersionModel){// TODO: apply your filteringapiVersionModel=new(apiVersionModel.SupportedApiVersions.Where(v =>true),apiVersionModel.DeprecatedApiVersions.Where(v =>true));inner.Report(response,apiVersionModel);}}
This would omit API versions you don't want to advertise from being emitted, but it doesn't change any declarations. Routing will continue to as is with your undisclosed versions.
Based off the discussion here it sounds possible - I haven't been able to find a way to not advertise an API version that is added by namespace convention.
The specific use case is to add a preview API version that only a small number of users would be aware of without advertising it in the header.
The text was updated successfully, but these errors were encountered: