public async Task <ActionResult> Get(string uri) { using var httpClient = new HttpClient(); var str = await httpClient.GetStringAsync(uri); // Read V3 as YAML var openApiDocument = new OpenApiStringReader().Read(str, out var diagnostic); // new OpenApiStreamReader().Read(stream, out var diagnostic); // Write V2 as JSON var outputString = openApiDocument.Serialize(OpenApiSpecVersion.OpenApi2_0, OpenApiFormat.Json); return(Ok(openApiDocument)); }