Skip to content

Commit

Permalink
chore: linting
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
  • Loading branch information
baywet committed Feb 4, 2025
1 parent a182f44 commit ee6fae2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
13 changes: 13 additions & 0 deletions src/Microsoft.OpenApi/IsExternalInit.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//TODO remove this if we ever remove the netstandard2.0 target
#if !NET5_0_OR_GREATER
namespace System.Runtime.CompilerServices {
using System.ComponentModel;
/// <summary>
/// Reserved to be used by the compiler for tracking metadata.
/// This class should not be used by developers in source code.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
internal static class IsExternalInit {
}
}
#endif
19 changes: 3 additions & 16 deletions src/Microsoft.OpenApi/Models/OpenApiReference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,6 @@
using Microsoft.OpenApi.Models.Interfaces;
using Microsoft.OpenApi.Writers;

#if !NET5_0_OR_GREATER
namespace System.Runtime.CompilerServices {
using System.ComponentModel;
/// <summary>
/// Reserved to be used by the compiler for tracking metadata.
/// This class should not be used by developers in source code.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
internal static class IsExternalInit {
}
}
#endif

namespace Microsoft.OpenApi.Models
{
/// <summary>
Expand Down Expand Up @@ -78,11 +65,11 @@ public class OpenApiReference : IOpenApiSerializable, IOpenApiDescribedElement,
/// </summary>
public bool IsFragment { get; init; }

private OpenApiDocument openApiDocument;
private OpenApiDocument hostDocument;
/// <summary>
/// The OpenApiDocument that is hosting the OpenApiReference instance. This is used to enable dereferencing the reference.
/// </summary>
public OpenApiDocument HostDocument { get => openApiDocument; init => openApiDocument = value; }
public OpenApiDocument HostDocument { get => hostDocument; init => hostDocument = value; }

/// <summary>
/// Gets the full reference string for v3.0.
Expand Down Expand Up @@ -301,7 +288,7 @@ private string GetReferenceTypeNameAsV2(ReferenceType type)
internal void EnsureHostDocumentIsSet(OpenApiDocument currentDocument)
{
Utils.CheckArgumentNull(currentDocument);
openApiDocument ??= currentDocument;
hostDocument ??= currentDocument;
}
}
}

0 comments on commit ee6fae2

Please # to comment.