-
Notifications
You must be signed in to change notification settings - Fork 271
Fix #172: Adding spec version to OpenApiDiagnostic of Reader #175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
doc = this.VersionService.LoadDocument(this.RootNode); | ||
diagnostic.SpecificationVersion = OpenApiSpecVersion.OpenApi3_0; | ||
} | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, spacing #Resolved
var callback = subscribeOperation.Callbacks["simpleHook"]; | ||
|
||
context.ShouldBeEquivalentTo(new OpenApiDiagnostic()); | ||
context.ShouldBeEquivalentTo( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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