From 2c3ba6c57d2500c0ee62a750f7b32065c4ad9e54 Mon Sep 17 00:00:00 2001 From: Egor Sidorenko Date: Wed, 26 Aug 2026 15:10:45 +0500 Subject: [PATCH 1/3] Add FilterRestrictions annotation to managedDevice The entity description says filtering is only supported on a subset of properties, but there was no FilterRestrictions annotation, so the metadata advertised the whole collection as filterable. Lists the 35 properties that are not filterable in either v1.0 or beta. The two that are filterable in beta only, deviceType and ownerType, are left out so the same annotation stays correct for both versions. --- transforms/csdl/preprocess_csdl.xsl | 69 +++++++++++++++++++ .../csdl/preprocess_csdl_test_input.xml | 3 + .../csdl/preprocess_csdl_test_output.xml | 47 +++++++++++++ 3 files changed, 119 insertions(+) diff --git a/transforms/csdl/preprocess_csdl.xsl b/transforms/csdl/preprocess_csdl.xsl index d44fe2c93..88ca4776c 100644 --- a/transforms/csdl/preprocess_csdl.xsl +++ b/transforms/csdl/preprocess_csdl.xsl @@ -1400,6 +1400,57 @@ + + + Org.OData.Capabilities.V1.FilterRestrictions + + + Filterable + true + + + NonFilterableProperties + + activationLockBypassCode + androidSecurityPatchLevel + azureADRegistered + configurationManagerClientEnabledFeatures + deviceActionResults + deviceEnrollmentType + deviceHealthAttestationState + deviceRegistrationState + easActivated + easActivationDateTime + easDeviceId + enrollmentProfileName + ethernetMacAddress + exchangeAccessStateReason + exchangeLastSuccessfulSyncDateTime + freeStorageSpaceInBytes + iccid + isEncrypted + isSupervised + managedDeviceName + managedDeviceOwnerType + managementCertificateExpirationDate + meid + notes + partnerReportedThreatState + physicalMemoryInBytes + remoteAssistanceSessionErrorDetails + remoteAssistanceSessionUrl + requireUserEnrollmentApproval + subscriberCarrier + totalStorageSpaceInBytes + udid + userDisplayName + userId + wiFiMacAddress + + + + + Org.OData.Capabilities.V1.ExpandRestrictions @@ -1792,6 +1843,16 @@ + + + + + microsoft.graph.managedDevice + + + + + @@ -2185,6 +2246,14 @@ + + + + + + + + + + diff --git a/transforms/csdl/preprocess_csdl_test_output.xml b/transforms/csdl/preprocess_csdl_test_output.xml index 1a0265333..f55f7f55f 100644 --- a/transforms/csdl/preprocess_csdl_test_output.xml +++ b/transforms/csdl/preprocess_csdl_test_output.xml @@ -934,6 +934,53 @@ + + + + + + + + activationLockBypassCode + androidSecurityPatchLevel + azureADRegistered + configurationManagerClientEnabledFeatures + deviceActionResults + deviceEnrollmentType + deviceHealthAttestationState + deviceRegistrationState + easActivated + easActivationDateTime + easDeviceId + enrollmentProfileName + ethernetMacAddress + exchangeAccessStateReason + exchangeLastSuccessfulSyncDateTime + freeStorageSpaceInBytes + iccid + isEncrypted + isSupervised + managedDeviceName + managedDeviceOwnerType + managementCertificateExpirationDate + meid + notes + partnerReportedThreatState + physicalMemoryInBytes + remoteAssistanceSessionErrorDetails + remoteAssistanceSessionUrl + requireUserEnrollmentApproval + subscriberCarrier + totalStorageSpaceInBytes + udid + userDisplayName + userId + wiFiMacAddress + + + + + From 298e34aa598254b872dbc41c9347df8c0c03b1b2 Mon Sep 17 00:00:00 2001 From: Egor Sidorenko Date: Thu, 27 Aug 2026 15:08:58 +0500 Subject: [PATCH 2/3] Skip the managedDevice FilterRestrictions transform when the annotation already exists --- transforms/csdl/preprocess_csdl.xsl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/transforms/csdl/preprocess_csdl.xsl b/transforms/csdl/preprocess_csdl.xsl index 88ca4776c..0d0ddaa1e 100644 --- a/transforms/csdl/preprocess_csdl.xsl +++ b/transforms/csdl/preprocess_csdl.xsl @@ -2247,10 +2247,13 @@ + - + + + From 939bab8c415e20517f0349d0fc45b3e8045a7d06 Mon Sep 17 00:00:00 2001 From: Egor Sidorenko Date: Thu, 27 Aug 2026 19:58:10 +0500 Subject: [PATCH 3/3] Add id to managedDevice NonFilterableProperties The service rejects $filter=id eq '' against managedDevice with HTTP 400 "Unsupported parameter found in query", the same failure cited in #1193, so id belongs in the NonFilterableProperties list this PR adds even though managedDevice inherits id from entity rather than declaring it itself. microsoft.graph.security.intelligenceProfile, also BaseType="graph.entity", already lists its inherited id the same way in this schema, and the OData spec's own-properties restriction only applies to RequiredProperties, not NonFilterableProperties. --- transforms/csdl/preprocess_csdl.xsl | 1 + transforms/csdl/preprocess_csdl_test_output.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/transforms/csdl/preprocess_csdl.xsl b/transforms/csdl/preprocess_csdl.xsl index 0d0ddaa1e..b6b282769 100644 --- a/transforms/csdl/preprocess_csdl.xsl +++ b/transforms/csdl/preprocess_csdl.xsl @@ -1428,6 +1428,7 @@ exchangeLastSuccessfulSyncDateTime freeStorageSpaceInBytes iccid + id isEncrypted isSupervised managedDeviceName diff --git a/transforms/csdl/preprocess_csdl_test_output.xml b/transforms/csdl/preprocess_csdl_test_output.xml index f55f7f55f..f12198e14 100644 --- a/transforms/csdl/preprocess_csdl_test_output.xml +++ b/transforms/csdl/preprocess_csdl_test_output.xml @@ -958,6 +958,7 @@ exchangeLastSuccessfulSyncDateTime freeStorageSpaceInBytes iccid + id isEncrypted isSupervised managedDeviceName