Skip to content

Commit e80f705

Browse files
Use url type for endpoint parameter in Azure Core Data Plane Service playground sample (#3839)
The playground sample was using `endpoint: string` instead of `endpoint: url` in the `@server` decorator, inconsistent with best practices and other samples throughout the codebase. ## Changes - Updated `packages/typespec-azure-playground-website/samples/azure-core.tsp` to use `endpoint: url` ```diff @server( "{endpoint}/widget", "Contoso Widget APIs", { - endpoint: string, + endpoint: url, } ) ``` This aligns with the pattern used in documentation and test files across the repository. <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>Default data plane service in playground should use a url endpoint</issue_title> > <issue_description>```@server( > "{endpoint}/widget", > "Contoso Widget APIs", > { > /** > Supported Widget Services endpoints (protocol and hostname, for example: > https://westus.api.widget.contoso.com). > */ > endpoint: string, > } > ) > ``` > Is there any reason to define this as a string? I believe the best practice is to use `url`. > > [Playground Link](https://azure.github.io/typespec-azure/playground/?sample=Azure+Core+Data+Plane+Service&options=%7B%22linterRuleSet%22%3A%7B%22extends%22%3A%5B%22%40azure-tools%2Ftypespec-azure-rulesets%2Fdata-plane%22%5D%7D%7D&vs=%7B%7D)</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes #3838 <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/Azure/typespec-azure/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: JoshLove-msft <[email protected]>
1 parent c10b5e2 commit e80f705

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/typespec-azure-playground-website/samples/azure-core.tsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ using Azure.Core.Traits;
2727
Supported Widget Services endpoints (protocol and hostname, for example:
2828
https://westus.api.widget.contoso.com).
2929
*/
30-
endpoint: string,
30+
endpoint: url,
3131
}
3232
)
3333
@versioned(Contoso.WidgetManager.Versions)

0 commit comments

Comments
 (0)