Skip to content

Commit 11fb89f

Browse files
committed
Fix up char-based checks
1 parent fb50e52 commit 11fb89f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/OpenApi/src/Services/Schemas/OpenApiSchemaService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ refNode is JsonValue refValue &&
558558
throw new InvalidOperationException($"Only fragment references (starting with '{OpenApiConstants.RefPrefix}') are supported. Found: {refPath}");
559559
}
560560

561-
var path = refPath.TrimStart('#').TrimStart('/');
561+
var path = refPath.TrimStart('#', '/');
562562
if (string.IsNullOrEmpty(path))
563563
{
564564
return rootSchema;
@@ -578,13 +578,13 @@ refNode is JsonValue refValue &&
578578
}
579579
else
580580
{
581-
var partialPath = string.Join("/", segments.Take(i + 1));
581+
var partialPath = string.Join('/', segments.Take(i + 1));
582582
throw new InvalidOperationException($"Failed to resolve reference '{refPath}': path segment '{segment}' not found at '#{partialPath}'");
583583
}
584584
}
585585
else
586586
{
587-
var partialPath = string.Join("/", segments.Take(i));
587+
var partialPath = string.Join('/', segments.Take(i));
588588
throw new InvalidOperationException($"Failed to resolve reference '{refPath}': cannot navigate beyond '#{partialPath}' - expected object but found {current?.GetType().Name ?? "null"}");
589589
}
590590
}

0 commit comments

Comments
 (0)