mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 15:42:48 -05:00
[PM-6165] Add x-enum-varnames to improve swagger generation (#3767)
Improves code generation of enums for the server bindings in the sdk. Bindings will now use the appropiate variable name from the server. Works by adding a filter which appends x-enum-varnames to enums with the name from c#.
This commit is contained in:
@ -5,6 +5,7 @@ using Bit.Core.IdentityServer;
|
||||
using Bit.Core.Settings;
|
||||
using Bit.Core.Utilities;
|
||||
using Bit.SharedWeb.Health;
|
||||
using Bit.SharedWeb.Swagger;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.OpenApi.Models;
|
||||
|
||||
@ -69,6 +70,8 @@ public static class ServiceCollectionExtensions
|
||||
config.DescribeAllParametersInCamelCase();
|
||||
// config.UseReferencedDefinitionsForEnums();
|
||||
|
||||
config.SchemaFilter<EnumSchemaFilter>();
|
||||
|
||||
var apiFilePath = Path.Combine(AppContext.BaseDirectory, "Api.xml");
|
||||
config.IncludeXmlComments(apiFilePath, true);
|
||||
var coreFilePath = Path.Combine(AppContext.BaseDirectory, "Core.xml");
|
||||
|
Reference in New Issue
Block a user