Skip to content
This repository was archived by the owner on Jun 5, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/api/mock-api-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { MockRequestHandler, processRequest } from "./request-processor";

export type HttpMethod = "get" | "post" | "put" | "patch" | "delete" | "head";

export type Category = "vanilla" | "azure" | "llc" | "optional";
export type Category = "vanilla" | "azure" | "dpg" | "optional";

export class MockApiRouter {
public router: Router;
Expand Down
2 changes: 1 addition & 1 deletion src/reporter/coverage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async function collectCoverage(coverageFolder: string) {
General: getMergedReport("vanilla"),
Azure: getMergedReport("azure"),
Optional: getMergedReport("optional"),
LLC: getMergedReport("llc"),
DPG: getMergedReport("dpg"),
};

if (Object.keys(report).every((cat) => Object.keys(report[cat]).length === 0)) {
Expand Down
2 changes: 1 addition & 1 deletion src/test-routes/llc/customization.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { app, json } from "../../api";

app.category("llc", () => {
app.category("dpg", () => {
app.get("/customization/model/raw", "GetRawModel", (req) => {
return {
status: 200,
Expand Down
18 changes: 9 additions & 9 deletions src/test-routes/llc/update.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
import { app, json, ValidationError } from "../../api";
import { coverageService } from "../../services";

app.category("llc", () => {
app.get("/servicedriven/parameters", "LLCAddOptionalInput", (req) => {
app.category("dpg", () => {
app.get("/servicedriven/parameters", "DPGAddOptionalInput", (req) => {
return {
status: 200,
body: json({ message: `An object was successfully returned` }),
};
});

coverageService.register("llc", "LLCNewBodyType.JSON");
coverageService.register("llc", "LLCNewBodyType.JPEG");
coverageService.register("dpg", "DPGNewBodyType.JSON");
coverageService.register("dpg", "DPGNewBodyType.JPEG");

app.post("/servicedriven/parameters", "LLCNewBodyType", (req) => {
app.post("/servicedriven/parameters", "DPGNewBodyType", (req) => {
switch (req.headers["content-type"]) {
case "image/jpeg":
// req.expect.rawBodyEquals("binary");
coverageService.track("llc", "LLCNewBodyType.JPEG");
coverageService.track("dpg", "DPGNewBodyType.JPEG");
return { status: 200 };
case "application/json":
req.expect.bodyEquals({ url: "http://example.org/myimage.jpeg" });
coverageService.track("llc", "LLCNewBodyType.JSON");
coverageService.track("dpg", "DPGNewBodyType.JSON");
return { status: 200 };
default:
throw new ValidationError("Should be image/jpeg or application/json", {}, req.headers["content-type"]);
}
});

app.delete("/servicedriven/parameters", "LLCAddNewOperation", (req) => {
app.delete("/servicedriven/parameters", "DPGAddNewOperation", (req) => {
return {
status: 204,
};
});

app.get("/servicedriven/newpath", "LLCAddNewPath", (req) => {
app.get("/servicedriven/newpath", "DPGAddNewPath", (req) => {
return {
status: 200,
body: json({ message: `An object was successfully returned` }),
Expand Down
13 changes: 9 additions & 4 deletions swagger/llc-customization.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "LLCClient",
"description": "LLC Swagger that tests our ability to grow up."
"title": "DPGClient",
"description": "DPG Swagger that tests our ability to grow up."
},
"host": "localhost:3000",
"schemes": ["http"],
Expand Down Expand Up @@ -38,7 +38,9 @@
"name": "input",
"in": "body",
"description": "Please put {'hello': 'world!'}",
"schema": { "$ref": "#/definitions/Input" },
"schema": {
"$ref": "#/definitions/Input"
},
"required": true
}
],
Expand All @@ -54,7 +56,10 @@
},
"/customization/paging/{mode}": {
"get": {
"x-ms-pageable": { "nextLinkName": "nextLink", "itemName": "values" },
"x-ms-pageable": {
"nextLinkName": "nextLink",
"itemName": "values"
},
"operationId": "getPages",
"description": "Get pages that you will either return to users in pages of raw bodies, or pages of models following growup.",
"parameters": [
Expand Down
8 changes: 5 additions & 3 deletions swagger/llc_initial.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "LLCClient",
"description": "LLC Swagger, this is the initial swagger a service could do"
"title": "DPGClient",
"description": "DPG Swagger, this is the initial swagger a service could do"
},
"host": "localhost:3000",
"schemes": ["http"],
Expand Down Expand Up @@ -80,7 +80,9 @@
"name": "parameter",
"in": "body",
"description": "I am a body parameter. My only valid JSON entry is { url: \"http://example.org/myimage.jpeg\" }",
"schema": { "$ref": "#/definitions/PostInput" },
"schema": {
"$ref": "#/definitions/PostInput"
},
"required": true
}
],
Expand Down
8 changes: 5 additions & 3 deletions swagger/llc_update1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "LLCClient",
"description": "LLC Swagger, this is the initial swagger a service could do"
"title": "DPGClient",
"description": "DPG Swagger, this is the initial swagger a service could do"
},
"host": "localhost:3000",
"schemes": ["http"],
Expand Down Expand Up @@ -99,7 +99,9 @@
"name": "parameter",
"in": "body",
"description": "I am a body parameter with a new content type. My only valid JSON entry is { url: \"http://example.org/myimage.jpeg\" }",
"schema": { "$ref": "#/definitions/PostInput" },
"schema": {
"$ref": "#/definitions/PostInput"
},
"required": true
}
],
Expand Down