Skip to content

v2 - loading the document requires knowing the format in advance #1918

Closed
@baywet

Description

new OpenApiStreamReader().Read(stream, out var diagnostic);

(or its async variant)

Did not require knowing the format of the document (JSON/YAML) in advance. This was handy as when building general purpose tools, it's not something that I know in advance. Parsing the file extension/url extension/response content type header might help discovering it, but it's not reliable.

The equivalent method

OpenApiDocument.LoadAsync(input, "unknown", settings)

Requires passing the format, which I believe is a regression in functionality. We should work to restore the same level of functionality.

Also, there are a number of places in the documentation and doc comments that still refer to the old initialization and require to be updated before GA.

https://github.com/search?q=repo%3Amicrosoft%2FOpenAPI.NET%20OpenApiStreamReader&type=code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    priority:p0Blocking issue/ loss of critical functions. An ICM may be filed to communicate urgency. SLA<=48hrs

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions