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

python emitter always pad specific enum name (e.g. int) #2639

Closed
msyyc opened this issue Jun 14, 2024 · 0 comments · Fixed by #2638
Closed

python emitter always pad specific enum name (e.g. int) #2639

msyyc opened this issue Jun 14, 2024 · 0 comments · Fixed by #2638
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved.

Comments

@msyyc
Copy link
Member

msyyc commented Jun 14, 2024

The follow typespec:

import "@typespec/http";
import "@azure-tools/cadl-ranch-expect";

using TypeSpec.Http;

@scenarioService("/authentication/api-key")
@doc("Illustrates clients generated with ApiKey authentication.")
@useAuth(ApiKeyAuth<ApiKeyLocation.header, "x-ms-api-key">)
namespace Authentication.ApiKey;

enum MyEnum {
  Enum: "Enum",
  Int: "Int",
}
model MyModel {
    type: MyEnum;
    int: int64;
}

@scenario
@scenarioDoc("Expects header 'x-ms-api-key': 'valid-key'")
@doc("Check whether client is authenticated")
@get
@route("/valid")
op valid(@body body: MyModel): NoContentResponse;

python emitter generates enum with padded enum name INT_ENUM which is expected to INIT

image

@msyyc msyyc added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jun 14, 2024
@msyyc msyyc self-assigned this Jun 14, 2024
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant