-
Notifications
You must be signed in to change notification settings - Fork 160
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
[experiment2][dpg] do not convert enum client parameters into string #4468
Conversation
@@ -498,7 +498,8 @@ public static bool IsIgnoredHeaderParameter(InputParameter operationParameter) | |||
|
|||
private Parameter BuildParameter(in InputParameter operationParameter, Type? typeOverride = null) | |||
{ | |||
CSharpType type = typeOverride != null ? new CSharpType(typeOverride, operationParameter.Type.IsNullable) : _typeFactory.CreateType(operationParameter.Type); | |||
CSharpType type = typeOverride != null ? new CSharpType(typeOverride, operationParameter.Type.IsNullable) : | |||
operationParameter is { IsApiVersion: true, Type: InputEnumType enumType } ? _typeFactory.CreateType(enumType.EnumValueType) : _typeFactory.CreateType(operationParameter.Type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Special handling of apiVersion
@@ -132,6 +133,9 @@ private ClientFields(IEnumerable<Parameter> parameters, InputAuth? authorization | |||
public FieldDeclaration? GetFieldByParameter(Parameter parameter) | |||
=> GetFieldByParameter(parameter.Name, parameter.Type); | |||
|
|||
public FieldDeclaration? GetFieldByName(string name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Provide this method for cases when we don't check type matching. I cannot remove GetFieldByPrarameter
, since in some cases we still need to check the type. For example, NamesConflict
test project provide a case when client parameter and query parameter have the same name. We actually rely on the type check to decide which should be used. Not sure if that's the best way to do.
Hi @archerzz. Thank you for your interest in helping to improve the Azure SDK experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days. |
Description
Instead of checking the enum value type against protocol parameter type, we just not check types when building operation chain.
Checklist
To ensure a quick review and merge, please ensure:
Ready to Land?