Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

check request.parameters exists #485

Merged
merged 2 commits into from
Aug 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions src/plugins/aznamer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,17 +209,19 @@ export class AzNamer {
}
});
operation.extensions['cli-split-operation-original-operation'].requests.forEach(request => {
request.parameters.forEach(parameter => {
if(!isNullOrUndefined(parameter.language['az'])) {
if(operation.language['az'].command.endsWith(' update') && parameter['flattened'] != true) {
let paramType = parameter.schema.type;
if(paramType == SchemaType.Any || paramType == SchemaType.Array || paramType == SchemaType.Object || paramType == SchemaType.Dictionary) {
param = parameter;
listCnt++;
if (request.parameters) {
request.parameters.forEach(parameter => {
if(!isNullOrUndefined(parameter.language['az'])) {
if(operation.language['az'].command.endsWith(' update') && parameter['flattened'] != true) {
let paramType = parameter.schema.type;
if(paramType == SchemaType.Any || paramType == SchemaType.Array || paramType == SchemaType.Object || paramType == SchemaType.Dictionary) {
param = parameter;
listCnt++;
}
}
}
}
});
});
};
})
if(listCnt == 1) {
operation.extensions['cli-split-operation-original-operation']['genericSetterParam'] = param;
Expand Down