Skip to content

Commit 083fd2e

Browse files
authored
Merge pull request #1130 from Fellmonkey/fix-enum-params
fix(.NET): pass enum value as string in API params
2 parents 0578617 + 30ca100 commit 083fd2e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

templates/dotnet/base/utils.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{% if parameters.all|length > 0 %}{% for parameter in parameters.all | filter((param) => not param.isGlobal) %}{{ _self.parameter(parameter) }}{% if not loop.last %}{{ ', ' }}{% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %},{% endif %}{% endif %}{% if 'multipart/form-data' in consumes %} Action<UploadProgress>? onProgress = null{% endif %}
77
{% endmacro %}
88
{% macro map_parameter(parameter) %}
9-
{% if parameter.name == 'orderType' %}{{ parameter.name | caseCamel ~ '.ToString()'}}{% elseif parameter.isGlobal %}{{ parameter.name | caseUcfirst | escapeKeyword }}{% else %}{{ parameter.name | caseCamel | escapeKeyword }}{% endif %}
9+
{% if parameter.name == 'orderType' %}{{ parameter.name | caseCamel ~ '.ToString()'}}{% elseif parameter.isGlobal %}{{ parameter.name | caseUcfirst | escapeKeyword }}{% elseif parameter.enumValues is not empty %}{{ parameter.name | caseCamel | escapeKeyword }}?.Value{% else %}{{ parameter.name | caseCamel | escapeKeyword }}{% endif %}
1010
{% endmacro %}
1111
{% macro methodNeedsSecurityParameters(method) %}
1212
{% if (method.type == "webAuth" or method.type == "location") and method.auth|length > 0 %}{{ true }}{% else %}{{false}}{% endif %}

0 commit comments

Comments
 (0)