Skip to content

Commit 0cf2c80

Browse files
committed
Updated directive to extend check to the api class
1 parent 112d4cb commit 0cf2c80

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

config/ModuleMetadata.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
"versions": {
2828
"authentication": {
2929
"prerelease": "",
30-
"version": "2.27.6"
30+
"version": "2.27.7"
3131
},
3232
"beta": {
3333
"prerelease": "",
34-
"version": "2.27.6"
34+
"version": "2.27.7"
3535
},
3636
"v1.0": {
3737
"prerelease": "",
38-
"version": "2.27.6"
38+
"version": "2.27.7"
3939
}
4040
}
4141
}

src/readme.graph.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,15 @@ directive:
753753
$ = $.replace(/request\.Content\s*=\s*new\s+global::System\.Net\.Http\.StringContent\(\s*null\s*!=\s*body\s*\?\s*new\s+Microsoft\.Graph\.Beta\.PowerShell\.Runtime\.Json\.XNodeArray\(.*?\)\s*:\s*null,\s*global::System\.Text\.Encoding\.UTF8\);/g,'request.Content = new global::System.Net.Http.StringContent(cleanedBody, global::System.Text.Encoding.UTF8);');
754754
755755
$ = $.replace(/cleanedBody = Microsoft.*.ReplaceAndRemoveSlashes\(cleanedBody\);/gm,'')
756+
757+
let nameSpacePrefixRegex = /(Microsoft(?:\.\w+)*?\.PowerShell)/gm
758+
let nameSpacePrefix = 'Microsoft.Graph.PowerShell';
759+
if($.match(nameSpacePrefixRegex)){
760+
let prefixMatch = nameSpacePrefixRegex.exec($);
761+
nameSpacePrefix = prefixMatch[1];
762+
}
763+
$ = $.replace(/cleanedBody\s*=\s*body\.ToJson\(null\)\.ToString\(\);/g,await ${nameSpacePrefix}.ModelExtensions.EnsurePropertiesAreReady(body, failOnExplicitNulls: false);\n cleanedBody = body.ToJson(null).ToString();`
764+
);
756765
return $
757766
}
758767

0 commit comments

Comments
 (0)