-
Notifications
You must be signed in to change notification settings - Fork 241
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
Fix: loading the document requires knowing the format in advance #1929
Closed
+772
−685
Closed
Changes from 19 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
ecdf133
Make format optional; infer it from the stream or textReader input in…
MaggieKimani1 76286ae
Convert the methods to async to avoid deadlocks
MaggieKimani1 ab059fc
Align wrapped params
MaggieKimani1 e01db74
Pass a cancellation token to allow cancelling requests/tasks
MaggieKimani1 f30add8
clean up code
MaggieKimani1 8d83694
Return the generic output of type T as part of the read result; clean…
MaggieKimani1 0c05c3f
Clean up tests to reflect new LoadAsync pattern
MaggieKimani1 917fae3
Update doc comments and doc initialization
MaggieKimani1 8b07082
Update public API
MaggieKimani1 a83461d
Refactor code to cater for non-seekable streams
MaggieKimani1 7468eb2
clean up code
MaggieKimani1 93ba1c1
chore: use of async life time for test initialization
baywet 47bfb6f
Move code block to a reusable method to avoid duplication
MaggieKimani1 49a181a
use async lifetime for test initialization
MaggieKimani1 ecb9d6e
code refactor to remove Task.Run on CPU bound operation
MaggieKimani1 ebdbbe6
remove Task.Run
MaggieKimani1 9389d79
pass cancellation token
MaggieKimani1 9a2be7f
run operation asynchronously
MaggieKimani1 f07ff44
Update public API
MaggieKimani1 afc4055
Update src/Microsoft.OpenApi/Reader/OpenApiModelFactory.cs
MaggieKimani1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
why are we adding the task run here?
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 caller is async here
OpenAPI.NET/src/Microsoft.OpenApi/Reader/OpenApiModelFactory.cs
Line 147 in f07ff44
And the interface method's equivalent in the JsonReader class is also async
OpenAPI.NET/src/Microsoft.OpenApi/Reader/OpenApiJsonReader.cs
Line 124 in f07ff44
If I change this method's signature to be synchronous, I'll also need to update this JSON content to be read synchronously:
OpenAPI.NET/src/Microsoft.OpenApi/Reader/OpenApiJsonReader.cs
Line 189 in f07ff44