Fix #172: Adding spec version to OpenApiDiagnostic of Reader#175
Conversation
| doc = this.VersionService.LoadDocument(this.RootNode); | ||
| diagnostic.SpecificationVersion = OpenApiSpecVersion.OpenApi3_0; | ||
| } | ||
| else |
There was a problem hiding this comment.
The else if (...) { } and else { ...} has the same codes? why cannot we merge them together?
@PerthCharern @darrelmiller #WontFix
There was a problem hiding this comment.
The "else" is for a default case. It is, but doesn't have to be, the same as the "else if". This makes sure we list out the cases for 2.0 and 3.0 explicitly.
If you are worried about code duplication, we can refactor the guts out.
In reply to: 160842325 [](ancestors = 160842325)
There was a problem hiding this comment.
|
I'd rather put these two tests in the same folder: test/Microsoft.OpenApi.Readers.Tests/OpenApiReaderTests The ComparisonTests in V2Tests should probably be moved out to this folder as well. #Resolved |
| diagnostic.Should().NotBeNull(); | ||
| diagnostic.SpecificationVersion.Should().Be( OpenApiSpecVersion.OpenApi3_0 ); | ||
| } | ||
| } |
There was a problem hiding this comment.
nit, spacing #Resolved
| var callback = subscribeOperation.Callbacks["simpleHook"]; | ||
|
|
||
| context.ShouldBeEquivalentTo(new OpenApiDiagnostic()); | ||
| context.ShouldBeEquivalentTo( |
There was a problem hiding this comment.
context [](start = 16, length = 7)
If you have some time, would you mind fixing these context -> diagnostic? If not, it's okay. We can do a big cleanup later. #Resolved
Introducing a property to track the specification version read, so consumers of the Reader have this metadata and do not have to parse it themselves. See #172