Skip to content

Commit

Permalink
fix(decorator): replace hard code url with {endpoint} in `@scenario…
Browse files Browse the repository at this point in the history
…Service`

Hard coded value should be replaced by a parameter, like Azure#425

fix Azure#597
  • Loading branch information
Mingzhe Huang (from Dev Box) committed Jun 13, 2024
1 parent 83c129b commit b1a7050
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/gold-horses-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@azure-tools/cadl-ranch-expect": patch
---

fix(decorator): replace hard code url with `{endpoint}` in `@scenarioService`
12 changes: 11 additions & 1 deletion packages/cadl-ranch-expect/src/decorators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,16 @@ export function $scenarioService(
derivedModels: [],
projectionsByName: [],
} as any);
context.call($server, target, "http://localhost:3000", "TestServer endpoint");

context.call($server, target, "{endpoint}", "Test server endpoint", {
kind: "Model",
properties: new Map().set("endpoint", { name: "endpoint", type: { kind: "url" } }),
decorators: [],
projections: [],
name: "parameters",
derivedModels: [],
projectionsByName: [],
} as any);

context.call($route, target, route);
}

0 comments on commit b1a7050

Please sign in to comment.