Skip to content

Commit 07f0a50

Browse files
committed
Fixed reflection error
1 parent 25d43cd commit 07f0a50

File tree

2 files changed

+28
-10
lines changed

2 files changed

+28
-10
lines changed

config/ModulesMapping.jsonc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
// "Applications": "^applicationTemplates\\.|^applications\\.|^servicePrincipals\\.|^onPremisesPublishingProfiles\\.|^users.appRoleAssignment$|^groups.appRoleAssignment$",
2+
"Applications": "^applicationTemplates\\.|^applications\\.|^servicePrincipals\\.|^onPremisesPublishingProfiles\\.|^users.appRoleAssignment$|^groups.appRoleAssignment$",
33
// "Bookings": "^bookingBusinesses\\.|^bookingCurrencies\\.|^solutions.booking.*.Actions$|^solutions.bookingBusiness$|^solutions.bookingCurrency$|^solutions.virtualEventsRoot$|^solutions.booking.*.Functions$|^solutions.solutionsRoot$",
44
// "BusinessScenario": "^solutions.businessScenario$|^solutions.BusinessScenario.*.Actions$|^solutions.BusinessScenario.*.Functions$",
55
// "BackupRestore": "^solutions.backupRestoreRoot$|^solutions.backupRestore.*.Actions$|^solutions.backupRestore.*.Functions$",
@@ -16,7 +16,7 @@
1616
// "DeviceManagement.Enrollment": "^deviceManagement.(.*Enrollment.*|.*Autopilot.*|.*depOnboarding.*|importedDeviceIdentity|onPremisesConditionalAccessSettings|windowsFeatureUpdateProfile)$|^roleManagement.roleManagement$|^roleManagement.rbacApplicationMultiple$|^roleManagement.unifiedRbacApplication$",
1717
// "DeviceManagement.Functions": "^deviceManagement.*.Functions$",
1818
// "DirectoryObjects": "^directoryObjects\\.|^directory.publicKeyInfrastructureRoot$",
19-
"Education": "^education\\.",
19+
// "Education": "^education\\.",
2020
// "Files": "^drives\\.|^shares\\.|^users.drive$|^groups.drive$",
2121
// "Financials": "^financials\\.",
2222
// "Groups": "^groups.group$|^groups.directoryObject$|^groups.conversation$|^groups.endpoint$|^groups.extension$|^groups.groupLifecyclePolicy$|^groups.resourceSpecificPermissionGrant$|^groups.profilePhoto$|^groups.conversationThread$|^groupLifecyclePolicies\\.|^users.group$|^groups.directorySetting$|^groups.*.Actions$|^groups.*.Functions$|^groupSettings\\.|^groups.groupSetting$|^groupSettingTemplates\\.",
@@ -28,7 +28,7 @@
2828
// "ManagedTenants": "^tenantRelationships.managedTenant$",
2929
// "NetworkAccess": "^networkAccess\\.",
3030
// "Notes": "^users.onenote$|^groups.onenote$|^sites.onenote$",
31-
"People": "^users.person$|^users.profile$|^users.officeGraphInsights$|^users.userAnalytics$",
31+
// "People": "^users.person$|^users.profile$|^users.officeGraphInsights$|^users.userAnalytics$",
3232
// "PersonalContacts": "^users.contactFolder$|^users.contact$",
3333
// "Planner": "^planner\\.|^users.plannerUser$|^groups.plannerGroup$",
3434
// "Reports": "^reports\\.|^auditLogs\\.|^deviceManagement.deviceManagementReports$|^admin.adminReportSetting",
@@ -37,7 +37,7 @@
3737
// "Security": "^security\\.|^users.security$",
3838
// "Sites": "^sites.baseSitePage$|^sites.site$|^sites.itemAnalytics$|^sites.columnDefinition$|^sites.contentType$|^sites.drive$|^sites.list$|^sites.sitePage$|^sites.permission$|^sites.store$|^users.site$|^groups.site$|^sites.*.Functions$|^sites.*.Actions$|^sites.richLongRunningOperation$|^termStore.sets.ListChildren$|^admin.sharepoint$",
3939
// "Teams": "^teams\\.|^chats\\.|^users.chat$|^appCatalogs.teamsApp$|^users.userTeamwork$|^teamwork\\.|^users.team$|^groups.team$",
40-
// "Users": "^users.user$|^users.directoryObject$|^users.licenseDetails$|^users.mailboxSettings|^users.notification$|^users.outlookUser$|^users.profilePhoto$|^users.userSettings$|^users.extension$|^users.oAuth2PermissionGrant$|^users.todo$|^users.itemInsights$|^users.servicePrincipal$",
40+
"Users": "^users.user$|^users.directoryObject$|^users.licenseDetails$|^users.mailboxSettings|^users.notification$|^users.outlookUser$|^users.profilePhoto$|^users.userSettings$|^users.extension$|^users.oAuth2PermissionGrant$|^users.todo$|^users.itemInsights$|^users.servicePrincipal$",
4141
// "Users.Actions": "^users.*.Actions$",
4242
// "Users.Functions": "^users.*.Functions$",
4343
// "WindowsUpdates": "^admin.adminWindows$"

tools/Custom/ModelExtensions.cs

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,35 @@ public static async Task EnsurePropertiesAreReady(
6060

6161
private static bool IsUnready(object model, PropertyInfo prop, MethodInfo isPropertySetMethod, bool failOnExplicitNulls)
6262
{
63-
bool isSet = (bool)isPropertySetMethod.Invoke(model, new object[] { prop.Name });
64-
if (!isSet) return false; // not marked as set, skip
63+
try
64+
{
65+
// Ensure method matches expected signature
66+
var parameters = isPropertySetMethod.GetParameters();
67+
if (parameters.Length != 1 || parameters[0].ParameterType != typeof(string))
68+
{
69+
Console.WriteLine($"WARNING: IsPropertySet signature mismatch for type {model.GetType().Name}");
70+
return false;
71+
}
72+
73+
bool isSet = (bool)isPropertySetMethod.Invoke(model, new object[] { prop.Name });
74+
if (!isSet) return false;
6575

66-
object value = prop.GetValue(model);
76+
object value = prop.GetValue(model);
77+
Console.WriteLine($"DEBUG: {prop.Name} = {value}, IsSet: {isSet}");
6778

68-
if (value == null)
69-
return failOnExplicitNulls; // null is OK in relaxed mode, fail in strict
79+
if (value == null)
80+
return failOnExplicitNulls;
7081

71-
return IsDefault(value);
82+
return IsDefault(value);
83+
}
84+
catch (Exception ex)
85+
{
86+
Console.WriteLine($"ERROR: Failed to check IsPropertySet for {prop.Name}{ex.Message}");
87+
return false;
88+
}
7289
}
7390

91+
7492
private static bool IsDefault(object value)
7593
{
7694
Type type = value.GetType();

0 commit comments

Comments
 (0)