1
0
mirror of https://github.com/bitwarden/server synced 2025-12-16 16:23:31 +00:00
Files
server/src/Api/Utilities/ApiExplorerGroupConvention.cs
2019-02-28 14:20:14 -05:00

14 lines
433 B
C#

using Microsoft.AspNetCore.Mvc.ApplicationModels;
namespace Bit.Api.Utilities
{
public class ApiExplorerGroupConvention : IControllerModelConvention
{
public void Apply(ControllerModel controller)
{
var controllerNamespace = controller.ControllerType.Namespace;
controller.ApiExplorer.GroupName = controllerNamespace.Contains(".Public.") ? "public" : "internal";
}
}
}