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

Fix bug: Unable to use {service-name} interpolation for filenames with openapi3-emitter when only one service is defined #6182

Merged
merged 12 commits into from
Mar 3, 2025
Prev Previous commit
Next Next commit
cleanup
  • Loading branch information
albertxavier100 committed Feb 28, 2025
commit 5289dbd8a7b01e242c757b175039ca5c91b00bc0
6 changes: 2 additions & 4 deletions packages/openapi3/test/test-host.ts
Original file line number Diff line number Diff line change
@@ -12,8 +12,7 @@ import { RestTestLibrary } from "@typespec/rest/testing";
import { VersioningTestLibrary } from "@typespec/versioning/testing";
import { XmlTestLibrary } from "@typespec/xml/testing";
import { ok } from "assert";
import { parse as yamlParse } from "yaml";
import { EmitterOptions } from "../../compiler/src/config/types.js";
import { parse } from "yaml";
import { OpenAPI3EmitterOptions } from "../src/lib.js";
import { OpenAPI3TestLibrary } from "../src/testing/index.js";
import { OpenAPI3Document } from "../src/types.js";
@@ -78,11 +77,10 @@ export async function emitOpenApiWithDiagnostics(
});
const content = runner.fs.get(outputFile);
ok(content, "Expected to have found openapi output");
const doc = fileType === "json" ? JSON.parse(content) : yamlParse(content);
const doc = fileType === "json" ? JSON.parse(content) : parse(content);
return [doc, diagnostics, content];
}


export async function diagnoseOpenApiFor(code: string, options: OpenAPI3EmitterOptions = {}) {
const runner = await createOpenAPITestRunner();
const diagnostics = await runner.diagnose(code, {
Loading
Oops, something went wrong.