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` (#598)
  • Loading branch information
archerzz authored Aug 23, 2024
1 parent d0c8551 commit 039ab07
Show file tree
Hide file tree
Showing 2 changed files with 20 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`
16 changes: 15 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,20 @@ 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: context.program!.getGlobalNamespaceType().namespaces.get("TypeSpec")!.scalars.get("string"),
defaultValue: { entityKind: "Value", valueKind: "StringValue", value: "http://localhost:3000" },
}),
decorators: [],
projections: [],
name: "parameters",
derivedModels: [],
projectionsByName: [],
} as any);

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

0 comments on commit 039ab07

Please sign in to comment.