@autorest/powershell 4.0.648 → 4.0.649
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"powershell/models/model-extensions.ts": "f0c617b9bfb04b4424a853e1b1eecba9059ba788",
|
|
76
76
|
"powershell/module/module-class.ts": "327af665b5d81e4cc1b8fa9da7382e9c73300de5",
|
|
77
77
|
"powershell/module/module-namespace.ts": "f6afc90087e8d733f0323b0de8ba41d923955732",
|
|
78
|
-
"powershell/package.json": "
|
|
78
|
+
"powershell/package.json": "0ad9307fc644b43169ed63b699e3fc37014eb47f",
|
|
79
79
|
"powershell/plugins/add-azure-completers-v2.ts": "3b1ddf7a067dbac2f07561fb3f6cbf1b66e555aa",
|
|
80
80
|
"powershell/plugins/create-commands-v2.ts": "915b737aad5f455a9cd0aa4e08034349a2de8ea0",
|
|
81
81
|
"powershell/plugins/cs-namer-v2.ts": "1b64031416f18b604950012b5683758adefce535",
|
|
@@ -343,7 +343,7 @@
|
|
|
343
343
|
"powershell/resources/templates/extensions.ejs": "f46279774a6b53295d868f8a0eba6ccab5c0dbe2",
|
|
344
344
|
"powershell/resources/templates/longRunningOperationMethod.ejs": "20e8b207b599ab4783f40c6abeffd3cebc1d8ff6",
|
|
345
345
|
"powershell/resources/templates/method.ejs": "5c0fbfa91207f625101584f207d2372e60da7ff2",
|
|
346
|
-
"powershell/resources/templates/methodBodyRestCall.ejs": "
|
|
346
|
+
"powershell/resources/templates/methodBodyRestCall.ejs": "1aa66b6a94942b413cb0d0cdcc84d0e9f36845ff",
|
|
347
347
|
"powershell/resources/templates/methodGroupInterface.ejs": "5f753b1aec3d91daf8987b7495507d707d886b6c",
|
|
348
348
|
"powershell/resources/templates/methodGroupInterfaceBody.ejs": "55ec86bdb828513b4c2dedae883a487b90709d27",
|
|
349
349
|
"powershell/resources/templates/model.ejs": "2ebf9803e8576bf59b9787984456c3a73a00475e",
|
package/package.json
CHANGED
|
@@ -131,10 +131,14 @@ var prefix = pathParameter.implementation == 'Client' ? `this${clientPrefix}.` :
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
<% } else {-%>
|
|
134
|
+
<% if (!queryParameter.required || (!project.helper.IsValueType(queryParameter.schema.type) && !project.helper.IsEnum(queryParameter.schema) && !(queryParameter.schema.choiceType && project.helper.IsValueType(queryParameter.schema.choiceType.type)))) {-%>
|
|
134
135
|
if (<%-prefix%><%-queryParameter.language.default.name%> != null)
|
|
135
136
|
{
|
|
136
137
|
_queryParameters.Add(string.Format("<%-queryParameter.language.default.serializedName%>={0}", <%-project.helper.PathParameterString(queryParameter, clientPrefix)%>));
|
|
137
138
|
}
|
|
139
|
+
<% } else {-%>
|
|
140
|
+
_queryParameters.Add(string.Format("<%-queryParameter.language.default.serializedName%>={0}", <%-project.helper.PathParameterString(queryParameter, clientPrefix)%>));
|
|
141
|
+
<% } -%>
|
|
138
142
|
<% }-%>
|
|
139
143
|
<% });}-%>
|
|
140
144
|
if (_queryParameters.Count > 0)
|
|
@@ -205,7 +209,7 @@ var prefix = parameter.implementation == 'Client' ? `this${clientPrefix}.` : ''-
|
|
|
205
209
|
_httpRequest.Content = new System.Net.Http.StreamContent(<%-parameter.language.default.name%>);
|
|
206
210
|
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("<%-method.requests[0].protocol.http.mediaTypes[0]%>");
|
|
207
211
|
}
|
|
208
|
-
<% } else if (!project.helper.IsValueType(parameter.schema.type) && !project.helper.IsEnum(parameter.schema) && !project.helper.
|
|
212
|
+
<% } else if (!parameter.required || (!project.helper.IsValueType(parameter.schema.type) && !project.helper.IsEnum(parameter.schema) && !(parameter.schema.choiceType && project.helper.IsValueType(parameter.schema.choiceType.type)))) {-%>
|
|
209
213
|
if(<%-parameter.language.default.name%> != null)
|
|
210
214
|
{
|
|
211
215
|
_requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(<%-parameter.language.default.name%>, <%-project.helper.GetSerializationSettings(parameter.schema, `this${clientPrefix}`)%>);
|