mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-08-22 03:13:58 +02:00
Support OpenAPI 3.2 QUERY and additional operations (#591)
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user