Skip to content

Commit 264226b

Browse files
Merge pull request #1866 from microsoft/mk/sync-dependabot-updates
Sync v2 branch with the latest changes in vnext
2 parents fed868c + a572a5f commit 264226b

File tree

7 files changed

+27
-19
lines changed

7 files changed

+27
-19
lines changed

.github/workflows/docker.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ jobs:
3030
id: getversion
3131
- name: Push to GitHub Packages - Nightly
3232
if: ${{ github.ref == 'refs/heads/vnext' }}
33-
uses: docker/build-push-action@v6.7.0
33+
uses: docker/build-push-action@v6.9.0
3434
with:
3535
push: true
3636
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:nightly
3737
- name: Push to GitHub Packages - Release
3838
if: ${{ github.ref == 'refs/heads/master' }}
39-
uses: docker/build-push-action@v6.7.0
39+
uses: docker/build-push-action@v6.9.0
4040
with:
4141
push: true
4242
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.getversion.outputs.version }}

src/Microsoft.OpenApi.Hidi/Microsoft.OpenApi.Hidi.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<Nullable>enable</Nullable>
1010
<ToolCommandName>hidi</ToolCommandName>
1111
<PackageOutputPath>./../../artifacts</PackageOutputPath>
12-
<Version>1.4.10</Version>
12+
<Version>1.4.11</Version>
1313
<Description>OpenAPI.NET CLI tool for slicing OpenAPI documents</Description>
1414
<SignAssembly>true</SignAssembly>
1515
<!-- https://github.com/dotnet/sourcelink/blob/main/docs/README.md#embeduntrackedsources -->
@@ -29,23 +29,23 @@
2929

3030
<ItemGroup>
3131
<PackageReference Include="Humanizer.Core" Version="2.14.1" />
32-
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
33-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
32+
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.1" />
33+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
3434
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
3535
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
3636
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.11.20">
3737
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3838
<PrivateAssets>all</PrivateAssets>
3939
</PackageReference>
4040
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
41-
<PackageReference Include="Microsoft.OData.Edm" Version="8.0.1" />
42-
<PackageReference Include="Microsoft.OpenApi.OData" Version="2.0.0-preview.2" />
41+
<PackageReference Include="Microsoft.OData.Edm" Version="8.0.2" />
42+
<PackageReference Include="Microsoft.OpenApi.OData" Version="2.0.0-preview.3" />
4343
<PackageReference Include="Microsoft.OpenApi.ApiManifest" Version="0.5.0-preview" />
4444
<PackageReference Include="System.CommandLine.Hosting" Version="0.4.0-alpha.22272.1" />
4545
<!--STJ
4646
required until Microsoft.Extensions.Logging.Console and Microsoft.Extensions.Configuration.Json
4747
update their dependencies -->
48-
<PackageReference Include="System.Text.Json" Version="8.0.4" />
48+
<PackageReference Include="System.Text.Json" Version="8.0.5" />
4949
</ItemGroup>
5050

5151
<ItemGroup>

src/Microsoft.OpenApi.Readers/Microsoft.OpenApi.Readers.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</PackageReference>
3232

3333
<PackageReference Include="SharpYaml" Version="2.1.1" />
34-
<PackageReference Include="System.Text.Json" Version="8.0.4" />
34+
<PackageReference Include="System.Text.Json" Version="8.0.5" />
3535
</ItemGroup>
3636

3737
<ItemGroup>

src/Microsoft.OpenApi.Workbench/Microsoft.OpenApi.Workbench.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1313
<PrivateAssets>all</PrivateAssets>
1414
</PackageReference>
15-
<PackageReference Include="Microsoft.Windows.Compatibility" Version="8.0.8" />
15+
<PackageReference Include="Microsoft.Windows.Compatibility" Version="8.0.10" />
1616
<!-- Microsoft.Windows.Compatibility 8.0.8 depends on 8.0.0 this dependency can be removed once they update theirs -->
1717
<PackageReference Include="System.Formats.Asn1" Version="8.0.1" />
1818
</ItemGroup>
Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license.
3-
43
using System;
4+
using System.Collections.Concurrent;
55
using System.Diagnostics.CodeAnalysis;
66
using System.Reflection;
77
using Microsoft.OpenApi.Attributes;
@@ -13,6 +13,8 @@ namespace Microsoft.OpenApi.Extensions
1313
/// </summary>
1414
public static class StringExtensions
1515
{
16+
private static readonly ConcurrentDictionary<Type, ConcurrentDictionary<string, object>> EnumDisplayCache = new();
17+
1618
/// <summary>
1719
/// Gets the enum value based on the given enum type and display name.
1820
/// </summary>
@@ -21,22 +23,28 @@ public static class StringExtensions
2123
{
2224
var type = typeof(T);
2325
if (!type.IsEnum)
24-
{
2526
return default;
26-
}
27+
28+
var displayMap = EnumDisplayCache.GetOrAdd(type, _ => new ConcurrentDictionary<string, object>(StringComparer.OrdinalIgnoreCase));
29+
30+
if (displayMap.TryGetValue(displayName, out var cachedValue))
31+
return (T)cachedValue;
32+
2733

2834
foreach (var field in type.GetFields(BindingFlags.Public | BindingFlags.Static))
2935
{
30-
var displayAttribute = (DisplayAttribute)field.GetCustomAttribute(typeof(DisplayAttribute));
31-
if (displayAttribute != null && displayAttribute.Name == displayName)
36+
var displayAttribute = field.GetCustomAttribute<DisplayAttribute>();
37+
if (displayAttribute != null && displayAttribute.Name.Equals(displayName, StringComparison.OrdinalIgnoreCase))
3238
{
33-
return (T)field.GetValue(null);
39+
var enumValue = (T)field.GetValue(null);
40+
displayMap.TryAdd(displayName, enumValue);
41+
return enumValue;
3442
}
3543
}
3644

3745
return default;
3846
}
3947
internal static string ToFirstCharacterLowerCase(this string input)
40-
=> string.IsNullOrEmpty(input) ? string.Empty : char.ToLowerInvariant(input[0]) + input.Substring(1);
48+
=> string.IsNullOrEmpty(input) ? string.Empty : char.ToLowerInvariant(input[0]) + input.Substring(1);
4149
}
4250
}

src/Microsoft.OpenApi/Microsoft.OpenApi.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
2323
</PropertyGroup>
2424
<ItemGroup>
25-
<PackageReference Include="System.Text.Json" Version="8.0.4" />
25+
<PackageReference Include="System.Text.Json" Version="8.0.5" />
2626
</ItemGroup>
2727

2828
<ItemGroup>

test/Microsoft.OpenApi.Readers.Tests/Microsoft.OpenApi.Readers.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<PackageReference Include="xunit" Version="2.9.2" />
2525
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" PrivateAssets="all" />
2626
<!--STJ required until Microsoft.Extensions.Logging.Console and Microsoft.Extensions.Configuration.Json update their dependencies -->
27-
<PackageReference Include="System.Text.Json" Version="8.0.4" />
27+
<PackageReference Include="System.Text.Json" Version="8.0.5" />
2828
</ItemGroup>
2929

3030
<ItemGroup>

0 commit comments

Comments
 (0)