Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
28 changes: 27 additions & 1 deletion transforms/csdl/preprocess_csdl.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -967,11 +967,37 @@
</xsl:call-template>
</xsl:element>
</xsl:element>
<xsl:element name="PropertyValue">
<xsl:attribute name="Property">Navigability</xsl:attribute>
<xsl:element name="EnumMember">Org.OData.Capabilities.V1.NavigationType/None</xsl:element>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:copy>
</xsl:template>

<xsl:template match="edm:Schema[@Namespace='microsoft.graph']/edm:EntityType[@Name='event']/edm:NavigationProperty[@Name='exceptionOccurrences']">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
<xsl:choose>
<xsl:when test="$open-api-generation='False'">
<xsl:element name="Annotations">
<xsl:attribute name="Target">microsoft.graph.event/exceptionOccurrences</xsl:attribute>
<xsl:element name="Annotation">
<xsl:attribute name="Term">Org.OData.Capabilities.V1.NavigationRestrictions</xsl:attribute>
<xsl:element name="Record" namespace="{namespace-uri()}">
<xsl:element name="PropertyValue">
<xsl:attribute name="Property">Navigability</xsl:attribute>
<xsl:element name="EnumMember">Org.OData.Capabilities.V1.NavigationType/None</xsl:element>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:when>
</xsl:choose>
</xsl:copy>
</xsl:template>

<!-- Add paths for user mailboxSettings by adding annotations to read and update the complex property-->
<xsl:template match="edm:Schema[@Namespace='microsoft.graph']/edm:EntityType[@Name='user']/edm:Property[@Name='mailboxSettings']">
<xsl:copy>
Expand Down Expand Up @@ -1375,7 +1401,7 @@
</xsl:template>

<!-- Add Navigation Restrictions Annotations -->
<xsl:template match="edm:Schema[@Namespace='microsoft.graph']">
<xsl:template match="edm:Schema[@Namespace='microsoft.graph']">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>

Expand Down
36 changes: 36 additions & 0 deletions transforms/csdl/preprocess_csdl_test_input.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,42 @@
<Property Name="ruleName" Type="Edm.String" />
<NavigationProperty Name="scheduledActionConfigurations" Type="Collection(graph.deviceManagementComplianceActionItem)" />
</EntityType>
<EntityType Name="event" BaseType="graph.outlookItem" OpenType="true">
<NavigationProperty Name="exceptionOccurrences" Type="Collection(graph.event)" ContainsTarget="true" />
<NavigationProperty Name="instances" Type="Collection(graph.event)" ContainsTarget="true">
<Annotation Term="Org.OData.Capabilities.V1.NavigationRestrictions">
<Record>
<PropertyValue Property="RestrictedProperties">
<Collection>
<Record>
<PropertyValue Property="NavigationProperty">
<PropertyPath>instances</PropertyPath>
</PropertyValue>
<PropertyValue Property="ReadRestrictions">
<Record>
<PropertyValue Property="CustomQueryOptions">
<Collection>
<Record>
<PropertyValue Property="Name" String="startDateTime" />
<PropertyValue Property="Description" String="The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00" />
<PropertyValue Property="Required" Bool="true" />
</Record>
<Record>
<PropertyValue Property="Name" String="endDateTime" />
<PropertyValue Property="Description" String="The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00" />
<PropertyValue Property="Required" Bool="true" />
</Record>
</Collection>
</PropertyValue>
</Record>
</PropertyValue>
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</NavigationProperty>
</EntityType>
<EntityType Name="plannerPlan" BaseType="graph.entity">
<Property Name="createdBy" Type="graph.identitySet" />
<Property Name="createdDateTime" Type="Edm.DateTimeOffset" />
Expand Down
49 changes: 49 additions & 0 deletions transforms/csdl/preprocess_csdl_test_output.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,55 @@
<Property Name="ruleName" Type="Edm.String" />
<NavigationProperty Name="scheduledActionConfigurations" Type="Collection(graph.deviceManagementComplianceActionItem)" ContainsTarget="true" />
</EntityType>
<EntityType Name="event" BaseType="graph.outlookItem" OpenType="true">
<NavigationProperty Name="exceptionOccurrences" Type="Collection(graph.event)" ContainsTarget="true">
<Annotations Target="microsoft.graph.event/exceptionOccurrences">
<Annotation Term="Org.OData.Capabilities.V1.NavigationRestrictions">
<Record>
<PropertyValue Property="Navigability">
<EnumMember>Org.OData.Capabilities.V1.NavigationType/None</EnumMember>
</PropertyValue>
</Record>
</Annotation>
</Annotations>
</NavigationProperty>
<NavigationProperty Name="instances" Type="Collection(graph.event)" ContainsTarget="true">
<Annotation Term="Org.OData.Capabilities.V1.NavigationRestrictions">
<Record>
<PropertyValue Property="RestrictedProperties">
<Collection>
<Record>
<PropertyValue Property="NavigationProperty">
<PropertyPath>instances</PropertyPath>
</PropertyValue>
<PropertyValue Property="ReadRestrictions">
<Record>
<PropertyValue Property="CustomQueryOptions">
<Collection>
<Record>
<PropertyValue Property="Name" String="startDateTime" />
<PropertyValue Property="Description" String="The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00" />
<PropertyValue Property="Required" Bool="true" />
</Record>
<Record>
<PropertyValue Property="Name" String="endDateTime" />
<PropertyValue Property="Description" String="The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00" />
<PropertyValue Property="Required" Bool="true" />
</Record>
</Collection>
</PropertyValue>
</Record>
</PropertyValue>
</Record>
</Collection>
</PropertyValue>
<PropertyValue Property="Navigability">
<EnumMember>Org.OData.Capabilities.V1.NavigationType/None</EnumMember>
</PropertyValue>
</Record>
</Annotation>
</NavigationProperty>
</EntityType>
<EntityType Name="plannerPlan" BaseType="graph.entity">
<Property Name="createdBy" Type="graph.identitySet" />
<Property Name="createdDateTime" Type="Edm.DateTimeOffset" />
Expand Down