From fb5ed082905c17811ec2cdcc63dc913e15e6a975 Mon Sep 17 00:00:00 2001 From: Chenjie Shi Date: Thu, 28 Mar 2024 11:30:46 +0800 Subject: [PATCH] fix duplicate `@server` definition (#542) * fix duplicate `@server` definition * changelog --- .changeset/strong-beers-fry.md | 5 +++++ .../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 +++------ 4 files changed, 12 insertions(+), 8 deletions(-) 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 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; /**