-
Notifications
You must be signed in to change notification settings - Fork 270
fix/static factories #2165
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
Merged
Merged
fix/static factories #2165
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
0ff19f8
draft: removes static registry for readers
baywet fe7a2fd
fix: removes static readers registry
baywet e29c01d
chore: default registration of json reader
baywet a8c7e16
chore: adds missing yaml reader for test
baywet 75e9d9a
chore: updates public export of API
baywet 243a111
fix: adds missing cancellation parameter to async method
baywet 01398f0
chore: adds missing yaml reader to settings for base tests
baywet f8a775b
chore: adds missing yaml reader for readers tests
baywet 0a819b4
chore; updates public api surface for missing cancellation token para…
baywet cea8929
chore: fixes potential NRT
baywet 9b910f3
fix: moves the http client for the reader to settings so it can be pa…
baywet 205fec1
chore: changes visibility of client getter to avoid it being used for…
baywet f257ad5
fix avoid creating a client for each request in hidi
baywet 0f23798
fix: avoid creating new http clients to load additional documents of …
baywet f260e58
chore: updates public api surface export
baywet 9386fae
fix: use a single http client in hidi
baywet 9d5787e
Merge branch 'main' into fix/static-factories
baywet c632305
chore: use try add instead of add
baywet 31bfaac
chore: adds tests on readers settings
baywet ea6e99b
chore: use the implemented operator
baywet 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 hidden or 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
22 changes: 22 additions & 0 deletions
22
src/Microsoft.OpenApi.Readers/OpenApiReaderSettingsExtensions.cs
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Microsoft.OpenApi.Interfaces; | ||
using Microsoft.OpenApi.Models; | ||
using Microsoft.OpenApi.Readers; | ||
|
||
namespace Microsoft.OpenApi.Reader; | ||
|
||
/// <summary> | ||
/// Extensions for <see cref="OpenApiReaderSettings"/> | ||
/// </summary> | ||
public static class OpenApiReaderSettingsExtensions | ||
{ | ||
/// <summary> | ||
/// Adds a reader for the specified format | ||
/// </summary> | ||
/// <param name="settings">The settings to add the reader to.</param> | ||
public static void AddYamlReader(this OpenApiReaderSettings settings) | ||
{ | ||
var yamlReader = new OpenApiYamlReader(); | ||
settings.TryAddReader(OpenApiConstants.Yaml, yamlReader); | ||
settings.TryAddReader(OpenApiConstants.Yml, yamlReader); | ||
} | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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 was deleted.
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.
Uh oh!
There was an error while loading. Please reload this page.