Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 27, 2026

Documentation Update: Parameter Renaming Guide

  • Review current documentation and understand the issue
  • Add complete section for "Renaming operation parameters" with clear examples
  • Include explanation about wire names vs. client names
  • Address review feedback: Remove Option 1 (direct decorator in main.tsp)
  • Address review feedback: Remove version-scoped parameter renaming section
  • Update documentation to only recommend client.tsp approach with @@clientName
  • Address review feedback: Add both generated API code and usage examples for all languages
  • Address review feedback: Make example self-contained with complete TypeSpec definition
  • Address review feedback: Separate main.tsp and client.tsp examples
  • Address review feedback: Add using statement for PetStoreNamespace in client.tsp
  • Ensure examples follow the same pattern as model/operation renaming
  • Add consistent subheadings for both operations and parameters
  • Final validation complete

Summary of Changes

Updated parameter renaming documentation with properly structured and complete examples:

Latest changes:

  • Added using PetStoreNamespace; statement: The client.tsp example now properly includes the using statement to reference entities from the main.tsp namespace
  • This makes the TypeSpec code syntactically correct and complete

The client.tsp example now includes:

  1. Import statements for main.tsp and the client generator core library
  2. Using statements for both Azure.ClientGenerator.Core and PetStoreNamespace
  3. The @@clientName decorators for parameter renaming

This ensures the example is a complete, working TypeSpec specification.

Original prompt

This section details on the original issue you should resolve

<issue_title>[DOC]: Describe how to rename a parameter of an operation in the client</issue_title>
<issue_description>There is a lack of document on how to rename a parameter in https://azure.github.io/typespec-azure/docs/howtos/generate-client-libraries/09renaming/

The document mentioned sample but I didn't find a real case:

Image

There is also the suggestion mentioned in the teams channel, so we need the document to clarify the right behaviour.

  • the name of an operation parameter is not part of the api-definition. In the case of query parameters like this, you can name the parameter on the wire using the @query decorator, and this is the value that shows up in the uri. So the recommended way to change the parameter name is just to change the name
  • Changing a parameter name is not an API breaking change, but it is an SDK breaking change. You can use the @renamedFrom() decorator to scope the change to the new api-version you are hopefully doi9ong this in (unless you want the change across all API versions.</issue_description>

<agent_instructions>Refine the doc: website\src\content\docs\docs\howtos\Generate client libraries\09renaming.mdx. Make the doc correct and clear and example for renaming parameter according to other examples</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@lirenhe @tadelesh, could you start with adding the TCGC part for this? thanks

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 27, 2026 03:25
Co-authored-by: tadelesh <1726438+tadelesh@users.noreply.github.com>
Co-authored-by: tadelesh <1726438+tadelesh@users.noreply.github.com>
Copilot AI changed the title [WIP] Update documentation for renaming operation parameters docs: Add parameter renaming guide to client library documentation Jan 27, 2026
Copilot AI requested a review from tadelesh January 27, 2026 03:27
Copy link
Member

@tadelesh tadelesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Resolve the comments.

… and remove version-scoped section

Co-authored-by: tadelesh <1726438+tadelesh@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 27, 2026

@copilot Resolve the comments.

All comments resolved in commit ccf1d8f:

  • Updated to only recommend client.tsp approach with @@clientName
  • Removed direct decorator approach (Option 1)
  • Removed version-scoped parameter renaming section

Copilot AI changed the title docs: Add parameter renaming guide to client library documentation docs: Add parameter renaming guide using client.tsp approach Jan 27, 2026
Copilot AI requested a review from tadelesh January 27, 2026 03:53
@tadelesh tadelesh marked this pull request as ready for review January 27, 2026 06:12
@azure-sdk
Copy link
Collaborator

No changes needing a change description found.

…parameter renaming section

Co-authored-by: tadelesh <1726438+tadelesh@users.noreply.github.com>
@azure-sdk
Copy link
Collaborator

You can try these changes here

🛝 Playground 🌐 Website

Copy link
Member

@tadelesh tadelesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot For each part of the example, instead of import "main.tsp";, please compose a complete example, adding:

namespace PetStoreNamespace;

/** This is the input I need */
@resource("input")
model InputModel {
  /** Id of this object */
  @key
  @visibility(Lifecycle.Read)
  name: string;
}

/** Read my resource */
op get is ResourceRead<InputModel>;

…peSpec definition

Co-authored-by: tadelesh <1726438+tadelesh@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 27, 2026

@copilot For each part of the example, instead of import "main.tsp";, please compose a complete example, adding:

namespace PetStoreNamespace;...

Updated the example to be self-contained. Replaced import "./main.tsp" with the complete TypeSpec definition including namespace, model, and operation declarations. (be6dcb6)

Copilot AI requested a review from tadelesh January 27, 2026 06:26
Co-authored-by: tadelesh <1726438+tadelesh@users.noreply.github.com>
Co-authored-by: tadelesh <1726438+tadelesh@users.noreply.github.com>
Copilot AI requested a review from tadelesh January 27, 2026 08:26
@tadelesh tadelesh enabled auto-merge January 28, 2026 05:55
@tadelesh tadelesh disabled auto-merge January 28, 2026 05:55
@tadelesh tadelesh enabled auto-merge January 28, 2026 05:56
@tadelesh tadelesh added this pull request to the merge queue Jan 30, 2026
Merged via the queue into main with commit 5242f60 Jan 30, 2026
21 checks passed
@tadelesh tadelesh deleted the copilot/update-renaming-parameter-docs branch January 30, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DOC]: Describe how to rename a parameter of an operation in the client

6 participants