From e5ddd701f9c3be4fab710d42338827bd41e9115d Mon Sep 17 00:00:00 2001 From: tadelesh Date: Wed, 27 Mar 2024 11:26:58 +0800 Subject: [PATCH 1/2] fix duplicate `@server` definition --- .../cadl-ranch-specs/http/server/path/single/main.tsp | 3 ++- .../http/server/versions/not-versioned/main.tsp | 3 ++- .../http/server/versions/versioned/main.tsp | 9 +++------ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/cadl-ranch-specs/http/server/path/single/main.tsp b/packages/cadl-ranch-specs/http/server/path/single/main.tsp index 0bddce185..bb83a1125 100644 --- a/packages/cadl-ranch-specs/http/server/path/single/main.tsp +++ b/packages/cadl-ranch-specs/http/server/path/single/main.tsp @@ -4,7 +4,7 @@ import "@azure-tools/cadl-ranch-expect"; using TypeSpec.Http; @doc("Illustrates server with a single path parameter @server") -@scenarioService("/server/path/single") +@service @server( "{endpoint}", "Testserver endpoint", @@ -13,6 +13,7 @@ using TypeSpec.Http; endpoint: url, } ) +@route("/server/path/single") namespace Server.Path.Single; @scenario diff --git a/packages/cadl-ranch-specs/http/server/versions/not-versioned/main.tsp b/packages/cadl-ranch-specs/http/server/versions/not-versioned/main.tsp index dae4901d1..7060c5bae 100644 --- a/packages/cadl-ranch-specs/http/server/versions/not-versioned/main.tsp +++ b/packages/cadl-ranch-specs/http/server/versions/not-versioned/main.tsp @@ -6,7 +6,7 @@ using TypeSpec.Http; /** * Illustrates not-versioned server. */ -@scenarioService("/server/versions/not-versioned") +@service @server( "{endpoint}", "Testserver endpoint", @@ -17,6 +17,7 @@ using TypeSpec.Http; endpoint: url, } ) +@route("/server/versions/not-versioned") namespace Server.Versions.NotVersioned; @scenario diff --git a/packages/cadl-ranch-specs/http/server/versions/versioned/main.tsp b/packages/cadl-ranch-specs/http/server/versions/versioned/main.tsp index 0b52015e9..05b9a4b0c 100644 --- a/packages/cadl-ranch-specs/http/server/versions/versioned/main.tsp +++ b/packages/cadl-ranch-specs/http/server/versions/versioned/main.tsp @@ -9,12 +9,8 @@ using TypeSpec.Versioning; /** * Illustrates versioned server. */ -@scenarioService( - "/server/versions/versioned", - { - versioned: Versions, - } -) +@service +@versioned(Versions) @server( "{endpoint}", "Testserver endpoint", @@ -25,6 +21,7 @@ using TypeSpec.Versioning; endpoint: url, } ) +@route("/server/versions/versioned") namespace Server.Versions.Versioned; /** From f3987589b4f0c35d46d80fb3e0de6c384a685f8f Mon Sep 17 00:00:00 2001 From: tadelesh Date: Wed, 27 Mar 2024 11:28:21 +0800 Subject: [PATCH 2/2] changelog --- .changeset/strong-beers-fry.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/strong-beers-fry.md diff --git a/.changeset/strong-beers-fry.md b/.changeset/strong-beers-fry.md new file mode 100644 index 000000000..b61885b51 --- /dev/null +++ b/.changeset/strong-beers-fry.md @@ -0,0 +1,5 @@ +--- +"@azure-tools/cadl-ranch-specs": patch +--- + +fix duplicate `@server` definition