Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] device registry tsp definition, wrong operationId in tsp example files #28804

Closed
XiaofeiCao opened this issue Apr 23, 2024 · 3 comments · Fixed by #28842
Closed

[BUG] device registry tsp definition, wrong operationId in tsp example files #28804

XiaofeiCao opened this issue Apr 23, 2024 · 3 comments · Fixed by #28842
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Mgmt This issue points to a problem in the management-plane of the library. TypeSpec Authored with TypeSpec

Comments

@XiaofeiCao
Copy link
Contributor

API Spec link

https://github.com/Azure/azure-rest-api-specs/blob/main/specification/deviceregistry/DeviceRegistry.Management/examples/2023-11-01-preview/Create_AssetEndpointProfile.json#L2

API Spec version

2023-11-01-preview

Describe the bug

operationId Create_AssetEndpointProfile is wrong

Expected behavior

Should be AssetEndpointProfiles_CreateOrReplace. Similar issues with all example files in examples folder.

Actual behavior

Create_AssetEndpointProfile

Reproduction Steps

example files issue. I tried to correct it, though generated swagger files contain duplicates...
https://github.com/Azure/azure-rest-api-specs/pull/28783/files

Environment

No response

@XiaofeiCao XiaofeiCao added bug This issue requires a change to an existing behavior in the product in order to be resolved. TypeSpec Authored with TypeSpec labels Apr 23, 2024
@zzhxiaofeng zzhxiaofeng added the Mgmt This issue points to a problem in the management-plane of the library. label Apr 24, 2024
@zzhxiaofeng
Copy link
Member

@davidemontanari Please help have a look, thank you.

@davidemontanari
Copy link
Member

davidemontanari commented Apr 25, 2024

@zzhxiaofeng, PR has been linked to this bug. Please take a look. Thanks.

@XiaofeiCao, the duplication happens because the resource operations are decorated with @Autorest.example(...) in the tsp files. Removing the decorator and linking the examples to the operations using the operationId removes the duplication.

@XiaofeiCao
Copy link
Contributor Author

Thanks @davidemontanari !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Mgmt This issue points to a problem in the management-plane of the library. TypeSpec Authored with TypeSpec
Projects
None yet
3 participants