Skip to content

Commit a20fc31

Browse files
committed
chore: reverts copilot hallucination changes
1 parent 4ac5a1b commit a20fc31

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"sdk": {
3-
"version": "8.0.116"
3+
"version": "8.0.406"
44
}
55
}

src/Microsoft.OpenApi/Models/BaseOpenApiReference.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,10 @@ internal void SetJsonPointerPath(string pointer, string nodeLocation)
316316
private static string ResolveRelativePointer(string nodeLocation, string relativeRef)
317317
{
318318
// Convert nodeLocation to path segments
319-
var segments = nodeLocation.TrimStart('#').Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries).ToList();
319+
var segments = nodeLocation.TrimStart('#').Split(['/'], StringSplitOptions.RemoveEmptyEntries).ToList();
320320

321321
// Convert relativeRef to dynamic segments
322-
var relativeSegments = relativeRef.TrimStart('#').Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
322+
var relativeSegments = relativeRef.TrimStart('#').Split(['/'], StringSplitOptions.RemoveEmptyEntries);
323323

324324
// Locate the first occurrence of relativeRef segments in the full path
325325
for (int i = 0; i <= segments.Count - relativeSegments.Length; i++)

src/Microsoft.OpenApi/Models/OpenApiDocument.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ private static string ConvertByteArrayToString(byte[] hash)
589589
// Enables setting the complete JSON path for nested subschemas e.g. #/components/schemas/person/properties/address
590590
if (useExternal)
591591
{
592-
var relPathSegment = referenceV3.Split(new char[] { '#' }, StringSplitOptions.RemoveEmptyEntries)[1];
592+
var relPathSegment = referenceV3.Split(['#'], StringSplitOptions.RemoveEmptyEntries)[1];
593593
relativePath = $"#{relPathSegment}";
594594
}
595595
else
@@ -625,7 +625,7 @@ private static bool IsSubComponent(string reference)
625625

626626
if (fragment.StartsWith("/components/schemas/", StringComparison.OrdinalIgnoreCase))
627627
{
628-
var segments = fragment.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
628+
var segments = fragment.Split(['/'], StringSplitOptions.RemoveEmptyEntries);
629629

630630
// Expect exactly 3 segments for root-level schema: ["components", "schemas", "person"]
631631
// Anything longer means it's a subcomponent.

src/Microsoft.OpenApi/Services/OpenApiWorkspace.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ public bool Contains(string location)
347347

348348
if (uri is not null)
349349
{
350-
pathSegments = uri.Fragment.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
350+
pathSegments = uri.Fragment.Split(['/'], StringSplitOptions.RemoveEmptyEntries);
351351

352352
// Build the base path for the root schema: "#/components/schemas/person"
353353
var fragment = OpenApiConstants.ComponentsSegment + ReferenceType.Schema.GetDisplayName() + ComponentSegmentSeparator + pathSegments[3];

0 commit comments

Comments
 (0)