You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to simply convert between OpenApiFormat while keeping OpenApiSpecVersion the same across the conversion, however, there is no way of doing this that avoids me having to parse the OpenApiSpecVersion from the string payload myself.
For example, below is some basic code to demonstrate the scenario and issue. In this example, we'd be converting YAML string -> OpenApirDocument model -> JSON string.
string documentYaml = "some YAML OpenApi document payload";
var openApiStringReader = new OpenApiStringReader();
OpenApiDocument openApiDocument = openApiStringReader.Read( documentYaml, out
OpenApiDiagnostic openApiDiagnostic );
string documentJson = openApiDocument.SerializeAsJson(???);
What is the recommended way of getting to know the OpenApiSpecVersion to pass to SerializeAsJson (respresented by ??? above) in order to keep the version consistent.