mirror of
https://github.com/bitwarden/server
synced 2025-12-17 08:43:27 +00:00
swagger specs for public api
This commit is contained in:
13
src/Api/Utilities/ApiExplorerGroupConvention.cs
Normal file
13
src/Api/Utilities/ApiExplorerGroupConvention.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
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";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user