diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json index a3dec870c8..56a89e2cc6 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json @@ -930,6 +930,9 @@ "Studio_GetInformed_Description1": "Leave your contact information to get informed and try it first when ABP Studio has been launched.", "Studio_GetInformed_Description2": "Planned preview release date:
Q3 of 2023.", "ThankYou!": "Thank you!", - "YouJoinedTheBetaTesterProgram": "You joined the ABP Studio beta tester program." + "SendBetaRequest": "Send Beta Request", + "YouJoinedTheBetaTesterProgram": "You joined the ABP Studio beta tester program.", + "PricingExplanation2": "30 days money back guarantee *. Learn more", + "MoneyBackGuaranteeText": "* 30-day money-back guarantee on all licenses! 100% refund on Team, 60% refund on Business and Enterprise licenses within 30 days." } } diff --git a/framework/src/Volo.Abp.Swashbuckle/Microsoft/Extensions/DependencyInjection/AbpSwaggerGenOptionsExtensions.cs b/framework/src/Volo.Abp.Swashbuckle/Microsoft/Extensions/DependencyInjection/AbpSwaggerGenOptionsExtensions.cs index 4313041064..240da0fc4e 100644 --- a/framework/src/Volo.Abp.Swashbuckle/Microsoft/Extensions/DependencyInjection/AbpSwaggerGenOptionsExtensions.cs +++ b/framework/src/Volo.Abp.Swashbuckle/Microsoft/Extensions/DependencyInjection/AbpSwaggerGenOptionsExtensions.cs @@ -9,4 +9,9 @@ public static class AbpSwaggerGenOptionsExtensions { swaggerGenOptions.DocumentFilter(); } + + public static void UserFriendlyEnums(this SwaggerGenOptions swaggerGenOptions) + { + swaggerGenOptions.SchemaFilter(); + } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.Swashbuckle/Volo/Abp/Swashbuckle/AbpSwashbuckleEnumSchemaFilter.cs b/framework/src/Volo.Abp.Swashbuckle/Volo/Abp/Swashbuckle/AbpSwashbuckleEnumSchemaFilter.cs new file mode 100644 index 0000000000..f637fb005e --- /dev/null +++ b/framework/src/Volo.Abp.Swashbuckle/Volo/Abp/Swashbuckle/AbpSwashbuckleEnumSchemaFilter.cs @@ -0,0 +1,23 @@ +using Microsoft.OpenApi.Any; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; +using System; +using System.Linq; + +namespace Volo.Abp.Swashbuckle; + +public class AbpSwashbuckleEnumSchemaFilter : ISchemaFilter +{ + public void Apply(OpenApiSchema schema, SchemaFilterContext context) + { + if (context.Type.IsEnum) + { + schema.Enum.Clear(); + schema.Type = nameof(String); + schema.Format = nameof(String); + Enum.GetNames(context.Type) + .ToList() + .ForEach(name => schema.Enum.Add(new OpenApiString($"{name}"))); + } + } +} \ No newline at end of file