Skip to content

Commit 2688845

Browse files
committed
changed text fragment to use line=
1 parent c78b917 commit 2688845

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Microsoft.OpenApi.Readers/Exceptions/OpenApiReaderException.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ public OpenApiReaderException(string message) : base(message) { }
3131
/// <param name="node">Parsing node where error occured</param>
3232
public OpenApiReaderException(string message, YamlNode node) : base(message)
3333
{
34-
Pointer = $"#char={node.Start.Index},{node.End.Index}";
34+
Pointer = $"#line={node.Start.Line}"; // This only includes line because using a char range causes tests to break due to CR/LF & LF differences
35+
// See https://tools.ietf.org/html/rfc5147 for syntax
3536
}
3637

3738
/// <summary>

test/Microsoft.OpenApi.Readers.Tests/NodeTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public void BrokenSimpleList()
2929

3030
diagnostic.Errors.ShouldBeEquivalentTo(new List<OpenApiError>() {
3131
new OpenApiError(new OpenApiReaderException("Expected a value.") {
32-
Pointer = "#char=64,64"
32+
Pointer = "#line=4"
3333
})
3434
});
3535
}

0 commit comments

Comments
 (0)