Skip to content
This repository has been archived by the owner on Jan 21, 2025. It is now read-only.

Commit

Permalink
Merge branch 'main' into dashboardFix
Browse files Browse the repository at this point in the history
  • Loading branch information
iscai-msft authored Aug 23, 2024
2 parents 3b566c3 + 039ab07 commit 40982c2
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/forty-brooms-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@azure-tools/cadl-ranch-specs": minor
---

Fix some minor issues in the namespace of azure/client-generate-core/flatten-property.
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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import "@azure-tools/cadl-ranch-expect";
import "@azure-tools/typespec-client-generator-core";

using TypeSpec.Http;
using Azure.ClientGenerator.Core;
using global.Azure.ClientGenerator.Core;

@doc("Illustrates the model flatten cases.")
@scenarioService("/azure/client-generator-core/flatten-property")
namespace Azure.ClientGenerator.Core.FlattenProperty;
namespace _Specs_.Azure.ClientGenerator.Core.FlattenProperty;

@doc("This is the model with one level of flattening.")
model FlattenModel {
Expand Down

0 comments on commit 40982c2

Please sign in to comment.