Support OpenAPI 3.2 QUERY and additional operations (#591)

This commit is contained in:
Gregory Schier
2026-08-19 07:10:32 -07:00
committed by GitHub
parent a2d54ca774
commit df1fd864b2
2 changed files with 42 additions and 5 deletions
@@ -13,6 +13,28 @@ describe("importer-openapi", () => {
.readdirSync(realWorldFixturesPath)
.filter((fixture) => fixture.endsWith(".yaml"));
test("Imports OpenAPI 3.2 QUERY and additional operations", async () => {
const imported = await convertOpenApi(
JSON.stringify({
openapi: "3.2.0",
info: { title: "OpenAPI 3.2 Operations", version: "1.0.0" },
paths: {
"/resources": {
query: { summary: "Query resources", responses: {} },
additionalOperations: {
COPY: { summary: "Copy resources", responses: {} },
},
},
},
}),
);
expect(imported?.resources.httpRequests).toEqual([
expect.objectContaining({ method: "QUERY", name: "Query resources", url: "/resources" }),
expect.objectContaining({ method: "COPY", name: "Copy resources", url: "/resources" }),
]);
});
test("Maps operation description to request description", async () => {
const imported = await convertOpenApi(
JSON.stringify({