You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (!$documentPath.match(/generated%5Capi%5CModels%5C\w*\d*.dictionary.cs/gm))
479
+
{
480
+
return $;
481
+
} else {
482
+
// Remove Count, Keys, and Values properties from implementations of an IAssociativeArray in models.
483
+
let propertiesToRemoveRegex = /^.*Microsoft\.Graph\.PowerShell\.Runtime\.IAssociativeArray<global::System\.Object>\.(Count|Keys|Values).*$/gm
484
+
$ = $.replace(propertiesToRemoveRegex, '');
485
+
472
486
return $;
473
487
}
474
488
# Modify generated .cs model classes.
@@ -479,30 +493,12 @@ directive:
479
493
{
480
494
return $;
481
495
} else {
482
-
// Add new modifier to 'values' properties of classes that derive from an IAssociativeArray. See example https://regex101.com/r/hnX7xO/2.
483
-
let valuesPropertiesRegex = /(SerializedName\s*=\s*@"values".*\s*.*)(\s*)(.*Values\s*{\s*get;\s*set;\s*})/gmi
484
-
if($.match(valuesPropertiesRegex)) {
485
-
$ = $.replace(valuesPropertiesRegex, '$1$2 new $3');
486
-
}
487
-
488
-
// Add new modifier to 'additionalProperties' properties of classes that derive from an IAssociativeArray. See example https://regex101.com/r/hnX7xO/2.
496
+
// Add new modifier to 'additionalProperties' properties of classes that implement IAssociativeArray. See example https://regex101.com/r/hnX7xO/2.
489
497
let additionalPropertiesRegex = /(SerializedName\s*=\s*@"additionalProperties".*\s*.*)(\s*)(.*AdditionalProperties\s*{\s*get;\s*set;\s*})/gmi
490
498
if($.match(additionalPropertiesRegex)) {
491
499
$ = $.replace(additionalPropertiesRegex, '$1$2 new $3');
492
500
}
493
501
494
-
// Add new modifier to 'keys' properties of classes that derive from an IAssociativeArray. See example https://regex101.com/r/hnX7xO/2.
495
-
let keysRegex = /(SerializedName\s*=\s*@"keys".*\s*.*)(\s*)(.*Keys\s*{\s*get;\s*set;\s*})/gmi
496
-
if($.match(keysRegex)) {
497
-
$ = $.replace(keysRegex, '$1$2 new $3');
498
-
}
499
-
500
-
// Add new modifier to 'count' properties of classes that derive from an IAssociativeArray. See example https://regex101.com/r/hnX7xO/2.
501
-
let countRegex = /(SerializedName\s*=\s*@"count".*\s*.*)(\s*)(.*Count\s*{\s*get;\s*set;\s*})/gmi
502
-
if($.match(countRegex)) {
503
-
$ = $.replace(countRegex, '$1$2 new $3');
504
-
}
505
-
506
502
let regexPattern = /^\s*public\s*partial\s*class\s*MicrosoftGraph(?<EntityName>.*):$/gm;
507
503
let regexArray;
508
504
while ((regexArray = regexPattern.exec($)) !== null) {
0 commit comments