Skip to content

Commit c46f13c

Browse files
Copilotbaywet
andauthored
style(library): move conditional compilation directives above namespace and rename V3_0 to V30
Agent-Logs-Url: https://github.com/microsoft/OpenAPI.NET/sessions/0fac65d3-0bbb-44db-b82e-7648c8fb8f86 Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
1 parent d3dd449 commit c46f13c

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/Microsoft.OpenApi/Attributes/ExperimentalAttribute.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
// Polyfill for ExperimentalAttribute which is only available in .NET 8+.
55
// Since the compiler queries for this attribute by name, having it source-included
66
// is sufficient for the compiler to recognize it.
7+
#if !NET8_0_OR_GREATER
78
namespace System.Diagnostics.CodeAnalysis
89
{
9-
#if !NET8_0_OR_GREATER
1010
/// <summary>
1111
/// Indicates that an API is experimental and it may change in the future.
1212
/// </summary>
@@ -42,5 +42,5 @@ public ExperimentalAttribute(string diagnosticId)
4242
/// </summary>
4343
public string? UrlFormat { get; set; }
4444
}
45-
#endif
4645
}
46+
#endif

src/Microsoft.OpenApi/Services/OpenApiPathHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static class OpenApiPathHelper
2727
],
2828
[OpenApiSpecVersion.OpenApi3_0] =
2929
[
30-
new V3_0UnsupportedPathPolicy(),
30+
new V30UnsupportedPathPolicy(),
3131
],
3232
};
3333

@@ -242,7 +242,7 @@ public bool TryGetVersionedPath(string[] segments, out string? result)
242242
/// Returns null for paths that have no equivalent in OpenAPI v3.0.
243243
/// Covers: webhooks (added in v3.1).
244244
/// </summary>
245-
internal sealed class V3_0UnsupportedPathPolicy : IOpenApiPathRepresentationPolicy
245+
internal sealed class V30UnsupportedPathPolicy : IOpenApiPathRepresentationPolicy
246246
{
247247
public bool TryGetVersionedPath(string[] segments, out string? result)
248248
{

0 commit comments

Comments
 (0)