You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.
Parsing a Swagger 2.0 file which contains tags in an operation field results in the following exception being thrown.
Message: System.ArgumentNullException : Value cannot be null.
Parameter name: stream.
I created a new test to demonstrate the problem. It pulls in the swagger petstore example yaml file.
`V2ParsingTests
using Xunit;
using Tavis.OpenApi;
namespace OpenApiTests.V2Tests
{
public class V2ParsingTests
{
[Theory,
InlineData("OpenApiTests.V2Tests.V2Samples.petstore.yaml", true)]
public void Tests(string filename, bool expectedResult)
{
var v2stream = this.GetType().Assembly.GetManifestResourceStream(filename);
var openApiDoc2 = OpenApiParser.Parse(v2stream).OpenApiDocument;
var result = openApiDoc2.Version == "2.0";
Assert.True(result == expectedResult);
}
}
}
`
This is the resultant stack trace when the test is executed
Test Name: OpenApiTests.V2Tests.V2ParsingTests.Tests(filename: "OpenApiTests.V2Tests.V2Samples.petstore.yaml", expectedResult: True)
Test FullName: OpenApiTests.V2Tests.V2ParsingTests.Tests
Test Source: C:\Users\Rich\source\repos\Tavis.OpenApi\src\OpenApiTests\V2Tests\V2ParsingTests.cs : line 11
Test Outcome: Failed
Test Duration: 0:00:00.083
Result StackTrace:
at System.IO.StreamReader..ctor(Stream stream, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean leaveOpen)
at System.IO.StreamReader..ctor(Stream stream)
at Tavis.OpenApi.OpenApiParser.Parse(Stream stream)
at OpenApiTests.V2Tests.V2ParsingTests.Tests(String filename, Boolean expectedResult) in C:\Users\Rich\source\repos\Tavis.OpenApi\src\OpenApiTests\V2Tests\V2ParsingTests.cs:line 13
Result Message:
System.ArgumentNullException : Value cannot be null.
Parameter name: stream
The text was updated successfully, but these errors were encountered:
Parsing a Swagger 2.0 file which contains tags in an operation field results in the following exception being thrown.
Message: System.ArgumentNullException : Value cannot be null.
Parameter name: stream.
I created a new test to demonstrate the problem. It pulls in the swagger petstore example yaml file.
`V2ParsingTests
using Xunit;
using Tavis.OpenApi;
namespace OpenApiTests.V2Tests
{
public class V2ParsingTests
{
[Theory,
InlineData("OpenApiTests.V2Tests.V2Samples.petstore.yaml", true)]
public void Tests(string filename, bool expectedResult)
{
var v2stream = this.GetType().Assembly.GetManifestResourceStream(filename);
var openApiDoc2 = OpenApiParser.Parse(v2stream).OpenApiDocument;
var result = openApiDoc2.Version == "2.0";
Assert.True(result == expectedResult);
}
}
`
This is the resultant stack trace when the test is executed
Test Name: OpenApiTests.V2Tests.V2ParsingTests.Tests(filename: "OpenApiTests.V2Tests.V2Samples.petstore.yaml", expectedResult: True)
Test FullName: OpenApiTests.V2Tests.V2ParsingTests.Tests
Test Source: C:\Users\Rich\source\repos\Tavis.OpenApi\src\OpenApiTests\V2Tests\V2ParsingTests.cs : line 11
Test Outcome: Failed
Test Duration: 0:00:00.083
Result StackTrace:
at System.IO.StreamReader..ctor(Stream stream, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean leaveOpen)
at System.IO.StreamReader..ctor(Stream stream)
at Tavis.OpenApi.OpenApiParser.Parse(Stream stream)
at OpenApiTests.V2Tests.V2ParsingTests.Tests(String filename, Boolean expectedResult) in C:\Users\Rich\source\repos\Tavis.OpenApi\src\OpenApiTests\V2Tests\V2ParsingTests.cs:line 13
Result Message:
System.ArgumentNullException : Value cannot be null.
Parameter name: stream
The text was updated successfully, but these errors were encountered: