diff --git a/.changeset/forty-brooms-fix.md b/.changeset/forty-brooms-fix.md new file mode 100644 index 000000000..ff2d5e4f1 --- /dev/null +++ b/.changeset/forty-brooms-fix.md @@ -0,0 +1,5 @@ +--- +"@azure-tools/cadl-ranch-specs": minor +--- + +Fix some minor issues in the namespace of azure/client-generate-core/flatten-property. diff --git a/.changeset/gold-horses-brake.md b/.changeset/gold-horses-brake.md new file mode 100644 index 000000000..5b73acf9a --- /dev/null +++ b/.changeset/gold-horses-brake.md @@ -0,0 +1,5 @@ +--- +"@azure-tools/cadl-ranch-expect": patch +--- + +fix(decorator): replace hard code url with `{endpoint}` in `@scenarioService` diff --git a/packages/cadl-ranch-expect/src/decorators.ts b/packages/cadl-ranch-expect/src/decorators.ts index b706467af..294285e53 100644 --- a/packages/cadl-ranch-expect/src/decorators.ts +++ b/packages/cadl-ranch-expect/src/decorators.ts @@ -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); } diff --git a/packages/cadl-ranch-specs/http/azure/client-generator-core/flatten-property/main.tsp b/packages/cadl-ranch-specs/http/azure/client-generator-core/flatten-property/main.tsp index 35a7e82ee..e84aaa145 100644 --- a/packages/cadl-ranch-specs/http/azure/client-generator-core/flatten-property/main.tsp +++ b/packages/cadl-ranch-specs/http/azure/client-generator-core/flatten-property/main.tsp @@ -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 {