Closed MaryGao closed 3 months ago
This is by design, as if you don't apply an @action
decorator, the final path of the action will match the name of the operation. Although, arguably, this would be a good candidate for a linter warning
@markcowl I think the root cause for this issue is the keyword is
has two different kind of meanings here. in the main.tsp, is
is being used to define an operation, and in the client.tsp, is
is being used to rename an operation. I feel like we should figure out a way to split the meaning here. Not sure we have any plan to redesign this ?
@qiaozha It should not be the case that 'is' is being used just to rename operations. In this case, @clientName should be able to handle the issue. Generally, in the client.tsp, 'is' is used for two reasons:
In the case of POST actions, the issue is that the last segment of the operation path comes from the operation name, unless it is explicitly set using @action . If we had a linting rule that detected the change of operation path through use of 'is', then authors of client.tsp could be warned away from patterns that change the operation path.
resolving as duplicate of https://github.com/Azure/typespec-azure/issues/297
Describe the bug
This is case in LoadTesting(spec here) and found in JS codegen(here). The auto-calculated route is different after adding customization in
client.tsp
.playground
main.tsp
The path we got is
/files/{fileName}:stop
.client.tsp
The path we got is
/files/{fileName}:stopTestRun
.Reproduction
playground The http path should be the same no matter we have client.tsp or not.
Checklist