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

tsp, honor name for Enum in TypeSpec #2940

Closed
weidongxu-microsoft opened this issue Aug 30, 2024 · 2 comments · Fixed by microsoft/typespec#4315
Closed

tsp, honor name for Enum in TypeSpec #2940

weidongxu-microsoft opened this issue Aug 30, 2024 · 2 comments · Fixed by microsoft/typespec#4315
Assignees
Labels
Mgmt This issue is related to a management-plane library.

Comments

@weidongxu-microsoft
Copy link
Member

weidongxu-microsoft commented Aug 30, 2024

For ARM, we didn't use the name for Enum
https://github.com/Azure/autorest.java/blob/main/javagen/src/main/java/com/azure/autorest/mapper/MapperUtils.java#L58-L66

We'd better use it for TypeSpec.

For impl, I guess a subclass, with a flag to util function?

@weidongxu-microsoft weidongxu-microsoft added the Mgmt This issue is related to a management-plane library. label Aug 30, 2024
@XiaofeiCao
Copy link
Contributor

Yes, we should adopt TypeSpec. For swagger, we remain the same.

@weidongxu-microsoft
Copy link
Member Author

BTW, the reason of the special handling for Swagger is that m4 would generate a name from the enum value (but we cannot distinguish whether the name is generated, or from x-ms-enum). And that name would already be processed and in many cases is worse that the enum value.

github-merge-queue bot pushed a commit to microsoft/typespec that referenced this issue Sep 20, 2024
github-merge-queue bot pushed a commit to microsoft/typespec that referenced this issue Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mgmt This issue is related to a management-plane library.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants