Browse Source

Merge branch 'dev' into salihozkara/studioPageLocalizations

pull/17135/head
Salih 3 years ago
parent
commit
ddc3ba3bde
  1. 5
      abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json
  2. 5
      framework/src/Volo.Abp.Swashbuckle/Microsoft/Extensions/DependencyInjection/AbpSwaggerGenOptionsExtensions.cs
  3. 23
      framework/src/Volo.Abp.Swashbuckle/Volo/Abp/Swashbuckle/AbpSwashbuckleEnumSchemaFilter.cs

5
abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json

@ -930,6 +930,9 @@
"Studio_GetInformed_Description1": "Leave your contact information to <span class=\"text-info\">get informed</span> and <span class=\"text-info\">try it first</span> when ABP Studio has been launched.",
"Studio_GetInformed_Description2": "Planned preview release date: <br/>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 *. <a href=\"/faq#refund-policy\">Learn more</a>",
"MoneyBackGuaranteeText": "* 30-day money-back guarantee on all licenses! 100% refund on Team, 60% refund on Business and Enterprise licenses within 30 days."
}
}

5
framework/src/Volo.Abp.Swashbuckle/Microsoft/Extensions/DependencyInjection/AbpSwaggerGenOptionsExtensions.cs

@ -9,4 +9,9 @@ public static class AbpSwaggerGenOptionsExtensions
{
swaggerGenOptions.DocumentFilter<AbpSwashbuckleDocumentFilter>();
}
public static void UserFriendlyEnums(this SwaggerGenOptions swaggerGenOptions)
{
swaggerGenOptions.SchemaFilter<AbpSwashbuckleEnumSchemaFilter>();
}
}

23
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}")));
}
}
}
Loading…
Cancel
Save