Azure / Azure/typespec-azure

Merge `@sharedRoute` operations into one

Open
#4,743 1 comment 0 reactions 2 assignees Claimed by @JialinHuang803 View on GitHub
emitter:typescript
Dominant language
TypeScript
Stars
27
Forks
90
Avg merge
1d 22h
Merged PRs (30d)
156

Description

https://azure.github.io/typespec-azure/docs/howtos/generate-client-libraries/04method/#merge-sharedroute-operations-into-one

If your shared routes are actually one unique semantic operation, you may want to configure codegen to use a unique name. This is simply done by renaming both operations to the same name using `@clientName`

typespec:
```
@sharedRoute
@route("/foo")
op a(x: int) : float

@sharedRoute
@route("/foo")
op b(x: string) : int64

// client.tsp
import "./main.tsp";
import "@azure-tools/typespec-client-generator-core";

using Azure.ClientGenerator.Core;

@@clientName(a, "Foo");
@@clientName(b, "Foo");
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.