Skip to content

Commit 945c754

Browse files
committed
chore: cleans up nullable directives
Signed-off-by: Vincent Biret <[email protected]>
1 parent 521d636 commit 945c754

File tree

11 files changed

+0
-23
lines changed

11 files changed

+0
-23
lines changed

src/Microsoft.OpenApi/Attributes/TrimmingAttributes.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license.
33

4-
#nullable enable
5-
64
// This collection of attribute definitions are helpers for accessing trim-related attributes in
75
// projects targeting .NET 6 or lower. Since the trimmer queries for these attributes by name, having
86
// these attributes source included is sufficient for the trimmer to recognize them. For more information

src/Microsoft.OpenApi/Extensions/OpenApiTypeMapper.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ namespace Microsoft.OpenApi.Extensions
1414
/// </summary>
1515
public static class OpenApiTypeMapper
1616
{
17-
#nullable enable
1817
/// <summary>
1918
/// Maps a JsonSchema data type to an identifier.
2019
/// </summary>
@@ -75,8 +74,6 @@ internal static string ToSingleIdentifier(this JsonSchemaType schemaType)
7574
return schemaType.ToIdentifiersInternal().Single();
7675
}
7776

78-
#nullable restore
79-
8077
/// <summary>
8178
/// Converts a schema type's identifier into the enum equivalent
8279
/// </summary>

src/Microsoft.OpenApi/Models/OpenApiComponents.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
using Microsoft.OpenApi.Models.References;
1010
using Microsoft.OpenApi.Writers;
1111

12-
#nullable enable
13-
1412
namespace Microsoft.OpenApi.Models
1513
{
1614
/// <summary>

src/Microsoft.OpenApi/Models/OpenApiDocument.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
using Microsoft.OpenApi.Services;
1818
using Microsoft.OpenApi.Writers;
1919

20-
#nullable enable
21-
2220
namespace Microsoft.OpenApi.Models
2321
{
2422
/// <summary>

src/Microsoft.OpenApi/Models/OpenApiMediaType.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
using Microsoft.OpenApi.Models.Interfaces;
1111
using Microsoft.OpenApi.Writers;
1212

13-
#nullable enable
14-
1513
namespace Microsoft.OpenApi.Models
1614
{
1715
/// <summary>

src/Microsoft.OpenApi/Models/OpenApiOperation.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
using Microsoft.OpenApi.Models.References;
1010
using Microsoft.OpenApi.Writers;
1111

12-
#nullable enable
13-
1412
namespace Microsoft.OpenApi.Models
1513
{
1614
/// <summary>

src/Microsoft.OpenApi/Models/OpenApiReference.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,10 +281,8 @@ internal void EnsureHostDocumentIsSet(OpenApiDocument currentDocument)
281281
Utils.CheckArgumentNull(currentDocument);
282282
hostDocument ??= currentDocument;
283283
}
284-
#nullable enable
285284
private static string? GetPropertyValueFromNode(JsonObject jsonObject, string key) =>
286285
jsonObject.TryGetPropertyValue(key, out var valueNode) && valueNode is JsonValue valueCast && valueCast.TryGetValue<string>(out var strValue) ? strValue : null;
287-
#nullable restore
288286
internal void SetSummaryAndDescriptionFromMapNode(MapNode mapNode)
289287
{
290288
var (description, summary) = mapNode.JsonNode switch {

src/Microsoft.OpenApi/OpenApiTagComparer.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Microsoft.OpenApi;
66

7-
#nullable enable
87
/// <summary>
98
/// This comparer is used to maintain a globally unique list of tags encountered
109
/// in a particular OpenAPI document.
@@ -44,4 +43,3 @@ public bool Equals(IOpenApiTag? x, IOpenApiTag? y)
4443
/// <inheritdoc/>
4544
public int GetHashCode(IOpenApiTag obj) => string.IsNullOrEmpty(obj?.Name) ? 0 : StringComparer.GetHashCode(obj!.Name);
4645
}
47-
#nullable restore

src/Microsoft.OpenApi/Services/OpenApiWalker.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ internal void Walk(OpenApiExternalDocs? externalDocs)
130130

131131
_visitor.Visit(externalDocs);
132132
}
133-
#nullable enable
134133
/// <summary>
135134
/// Visits <see cref="OpenApiComponents"/> and child objects
136135
/// </summary>
@@ -256,7 +255,6 @@ internal void Walk(OpenApiComponents? components)
256255
Walk(components as IOpenApiExtensible);
257256
}
258257

259-
#nullable restore
260258
/// <summary>
261259
/// Visits <see cref="OpenApiPaths"/> and child objects
262260
/// </summary>

src/Microsoft.OpenApi/Services/OpenApiWorkspace.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@ public bool Contains(string location)
281281
return _IOpenApiReferenceableRegistry.ContainsKey(key) || _artifactsRegistry.ContainsKey(key);
282282
}
283283

284-
#nullable enable
285284
/// <summary>
286285
/// Resolves a reference given a key.
287286
/// </summary>
@@ -307,7 +306,6 @@ public bool Contains(string location)
307306

308307
return default;
309308
}
310-
#nullable restore
311309

312310
private Uri? ToLocationUrl(string location)
313311
{

0 commit comments

Comments
 (0)