Skip to content
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

[API review] Evaluate format default value in Load methods #1964

Closed
RachitMalik12 opened this issue Nov 26, 2024 · 1 comment · Fixed by #1975
Closed

[API review] Evaluate format default value in Load methods #1964

RachitMalik12 opened this issue Nov 26, 2024 · 1 comment · Fixed by #1975
Labels
priority:p1 High priority but not blocking. Causes major but not critical loss of functionality SLA <=7days
Milestone

Comments

@RachitMalik12
Copy link

Where the loading methods are used without a format property, we will attempt to parse the document using the default JSON reader. If that fails and the Yaml reader is registered, then we will attempt to read as YAML.

Evaluate if the following methods should have default format value of "json" or the best way to manage the default format value:

public class OpenApiDocument {
    public static async Task<ReadResult> LoadAsync(string url, OpenApiReaderSettings settings = null) {}
    public static async Task<ReadResult> LoadAsync(Stream stream, string? format = null, OpenApiReaderSettings? settings = null) {}
    public static ReadResult Load(MemoryStream stream, string? format = null, OpenApiReaderSettings? settings = null) {}
    public static ReadResult Parse(string input,string? format = null,OpenApiReaderSettings? settings = null) {}
}
@RachitMalik12 RachitMalik12 added this to the NET:2.0 milestone Nov 26, 2024
@RachitMalik12 RachitMalik12 added the priority:p1 High priority but not blocking. Causes major but not critical loss of functionality SLA <=7days label Dec 3, 2024
@MaggieKimani1
Copy link
Contributor

Linking this issue as a reference particularly the ongoing discussion on whether to use JSON as a default format or opt to "sniff" the first bytes of a stream to detect its format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:p1 High priority but not blocking. Causes major but not critical loss of functionality SLA <=7days
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants