Skip to content

Commit ef7ae33

Browse files
authored
Merge pull request #2429 from microsoft/fix/mermaid-types
fix: removes public mermaid types that were not usuable
2 parents 1e9112a + 0c10c4a commit ef7ae33

File tree

6 files changed

+14
-22
lines changed

6 files changed

+14
-22
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<NoWarn>$(NoWarn);NU5048;NU5104;CA1848;</NoWarn>
1717
<PackageReadmeFile>readme.md</PackageReadmeFile>
1818
<AnalysisMode>All</AnalysisMode>
19+
<AssemblyOriginatorKeyFile>..\Microsoft.OpenApi.snk</AssemblyOriginatorKeyFile>
1920
</PropertyGroup>
2021

2122
<ItemGroup>
@@ -51,7 +52,10 @@
5152
<!-- Make internals available for Unit Testing -->
5253
<ItemGroup>
5354
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
54-
<_Parameter1>Microsoft.OpenApi.Hidi.Tests</_Parameter1>
55+
<_Parameter1>Microsoft.OpenApi.Hidi.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100957cb48387b2a5f54f5ce39255f18f26d32a39990db27cf48737afc6bc62759ba996b8a2bfb675d4e39f3d06ecb55a178b1b4031dcb2a767e29977d88cce864a0d16bfc1b3bebb0edf9fe285f10fffc0a85f93d664fa05af07faa3aad2e545182dbf787e3fd32b56aca95df1a3c4e75dec164a3f1a4c653d971b01ffc39eb3c4</_Parameter1>
56+
</AssemblyAttribute>
57+
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
58+
<_Parameter1>DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7</_Parameter1>
5559
</AssemblyAttribute>
5660
</ItemGroup>
5761
<!-- End Unit test Internals -->

src/Microsoft.OpenApi.Hidi/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/Microsoft.OpenApi/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
using System.Runtime.CompilerServices;
55

6+
[assembly:
7+
InternalsVisibleTo(
8+
"Microsoft.OpenApi.Hidi, PublicKey=0024000004800000940000000602000000240000525341310004000001000100957cb48387b2a5f54f5ce39255f18f26d32a39990db27cf48737afc6bc62759ba996b8a2bfb675d4e39f3d06ecb55a178b1b4031dcb2a767e29977d88cce864a0d16bfc1b3bebb0edf9fe285f10fffc0a85f93d664fa05af07faa3aad2e545182dbf787e3fd32b56aca95df1a3c4e75dec164a3f1a4c653d971b01ffc39eb3c4")]
69
[assembly:
710
InternalsVisibleTo(
811
"Microsoft.OpenApi.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100957cb48387b2a5f54f5ce39255f18f26d32a39990db27cf48737afc6bc62759ba996b8a2bfb675d4e39f3d06ecb55a178b1b4031dcb2a767e29977d88cce864a0d16bfc1b3bebb0edf9fe285f10fffc0a85f93d664fa05af07faa3aad2e545182dbf787e3fd32b56aca95df1a3c4e75dec164a3f1a4c653d971b01ffc39eb3c4")]

src/Microsoft.OpenApi/Services/OpenApiUrlTreeNode.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ public void WriteMermaid(TextWriter writer)
251251
/// <summary>
252252
/// Dictionary that maps a set of HTTP methods to HTML color. Keys are sorted, upper-cased, concatenated HTTP methods.
253253
/// </summary>
254-
public readonly static IReadOnlyDictionary<string, MermaidNodeStyle> MermaidNodeStyles = new Dictionary<string, MermaidNodeStyle>(StringComparer.OrdinalIgnoreCase)
254+
internal static readonly IReadOnlyDictionary<string, MermaidNodeStyle> MermaidNodeStyles = new Dictionary<string, MermaidNodeStyle>(StringComparer.OrdinalIgnoreCase)
255255
{
256256
{ "GET", new MermaidNodeStyle("lightSteelBlue", MermaidNodeShape.SquareCornerRectangle) },
257257
{ "POST", new MermaidNodeStyle("Lightcoral", MermaidNodeShape.OddShape) },
@@ -334,7 +334,7 @@ private static string SanitizeMermaidNode(string token)
334334
/// <summary>
335335
/// Defines the color and shape of a node in a Mermaid graph diagram
336336
/// </summary>
337-
public class MermaidNodeStyle
337+
internal class MermaidNodeStyle
338338
{
339339
/// <summary>
340340
/// Create a style that defines the color and shape of a diagram element
@@ -361,7 +361,7 @@ internal MermaidNodeStyle(string color, MermaidNodeShape shape)
361361
/// <summary>
362362
/// Shapes supported by Mermaid diagrams
363363
/// </summary>
364-
public enum MermaidNodeShape
364+
internal enum MermaidNodeShape
365365
{
366366
/// <summary>
367367
/// Rectangle with square corners

test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
<IsPackable>false</IsPackable>
99
<AnalysisMode>All</AnalysisMode>
1010
<NoWarn>CA2007</NoWarn>
11+
<SignAssembly>true</SignAssembly>
12+
<AssemblyOriginatorKeyFile>..\..\src\Microsoft.OpenApi.snk</AssemblyOriginatorKeyFile>
1113
</PropertyGroup>
1214

1315
<ItemGroup>

test/Microsoft.OpenApi.Tests/PublicApi/PublicApi.approved.txt

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[assembly: System.Reflection.AssemblyMetadata("IsTrimmable", "True")]
22
[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/Microsoft/OpenAPI.NET")]
3+
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(@"Microsoft.OpenApi.Hidi, PublicKey=0024000004800000940000000602000000240000525341310004000001000100957cb48387b2a5f54f5ce39255f18f26d32a39990db27cf48737afc6bc62759ba996b8a2bfb675d4e39f3d06ecb55a178b1b4031dcb2a767e29977d88cce864a0d16bfc1b3bebb0edf9fe285f10fffc0a85f93d664fa05af07faa3aad2e545182dbf787e3fd32b56aca95df1a3c4e75dec164a3f1a4c653d971b01ffc39eb3c4")]
34
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(@"Microsoft.OpenApi.Readers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100957cb48387b2a5f54f5ce39255f18f26d32a39990db27cf48737afc6bc62759ba996b8a2bfb675d4e39f3d06ecb55a178b1b4031dcb2a767e29977d88cce864a0d16bfc1b3bebb0edf9fe285f10fffc0a85f93d664fa05af07faa3aad2e545182dbf787e3fd32b56aca95df1a3c4e75dec164a3f1a4c653d971b01ffc39eb3c4")]
45
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(@"Microsoft.OpenApi.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100957cb48387b2a5f54f5ce39255f18f26d32a39990db27cf48737afc6bc62759ba996b8a2bfb675d4e39f3d06ecb55a178b1b4031dcb2a767e29977d88cce864a0d16bfc1b3bebb0edf9fe285f10fffc0a85f93d664fa05af07faa3aad2e545182dbf787e3fd32b56aca95df1a3c4e75dec164a3f1a4c653d971b01ffc39eb3c4")]
56
[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName=".NET 8.0")]
@@ -356,19 +357,6 @@ namespace Microsoft.OpenApi
356357
Object = 32,
357358
Array = 64,
358359
}
359-
public enum MermaidNodeShape
360-
{
361-
SquareCornerRectangle = 0,
362-
RoundedCornerRectangle = 1,
363-
Circle = 2,
364-
Rhombus = 3,
365-
OddShape = 4,
366-
}
367-
public class MermaidNodeStyle
368-
{
369-
public string Color { get; }
370-
public Microsoft.OpenApi.MermaidNodeShape Shape { get; }
371-
}
372360
public sealed class MethodExpression : Microsoft.OpenApi.RuntimeExpression
373361
{
374362
public const string Method = "$method";
@@ -1408,7 +1396,6 @@ namespace Microsoft.OpenApi
14081396
}
14091397
public class OpenApiUrlTreeNode
14101398
{
1411-
public static readonly System.Collections.Generic.IReadOnlyDictionary<string, Microsoft.OpenApi.MermaidNodeStyle> MermaidNodeStyles;
14121399
public System.Collections.Generic.IDictionary<string, System.Collections.Generic.List<string>> AdditionalData { get; set; }
14131400
public System.Collections.Generic.IDictionary<string, Microsoft.OpenApi.OpenApiUrlTreeNode> Children { get; }
14141401
public bool IsParameter { get; }

0 commit comments

Comments
 (0)