Skip to content

Commit

Permalink
- fixes inner error injection to avoid reoving the annotations
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
  • Loading branch information
baywet committed Feb 3, 2022
1 parent d4307f8 commit 935876f
Showing 1 changed file with 32 additions and 37 deletions.
69 changes: 32 additions & 37 deletions transforms/csdl/preprocess_csdl.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,38 @@
<xsl:template match="edm:Schema[@Namespace='microsoft.graph']">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
<xsl:choose>
<!-- Add inner error description -->
<xsl:when test="$add-innererror-description='True'">
<xsl:element name="ComplexType">
<xsl:attribute name="Name">InnerError</xsl:attribute>
<xsl:element name="Property">
<xsl:attribute name="Name">request-id</xsl:attribute>
<xsl:attribute name="Type">Edm.String</xsl:attribute>
<xsl:element name="Annotation">
<xsl:attribute name="Term">Org.OData.Core.V1.Description</xsl:attribute>
<xsl:attribute name="String">Request Id as tracked internally by the service</xsl:attribute>
</xsl:element>
</xsl:element>
<xsl:element name="Property">
<xsl:attribute name="Name">client-request-id</xsl:attribute>
<xsl:attribute name="Type">Edm.String</xsl:attribute>
<xsl:element name="Annotation">
<xsl:attribute name="Term">Org.OData.Core.V1.Description</xsl:attribute>
<xsl:attribute name="String">Client request Id as sent by the client application.</xsl:attribute>
</xsl:element>
</xsl:element>
<xsl:element name="Property">
<xsl:attribute name="Name">Date</xsl:attribute>
<xsl:attribute name="Type">Edm.DateTimeOffset</xsl:attribute>
<xsl:element name="Annotation">
<xsl:attribute name="Term">Org.OData.Core.V1.Description</xsl:attribute>
<xsl:attribute name="String">Date when the error occured.</xsl:attribute>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:when>
</xsl:choose>
<!-- Remove navigability for workbook navigation property -->
<xsl:element name="Annotations">
<xsl:attribute name="Target">microsoft.graph.driveItem/workbook</xsl:attribute>
Expand Down Expand Up @@ -636,41 +668,4 @@
</xsl:copy>
</xsl:template>

<!-- Add inner error description -->
<xsl:template match="edm:Schema[@Namespace='microsoft.graph']">
<xsl:choose>
<xsl:when test="$add-innererror-description='True'">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
<xsl:element name="ComplexType">
<xsl:attribute name="Name">InnerError</xsl:attribute>
<xsl:element name="Property">
<xsl:attribute name="Name">request-id</xsl:attribute>
<xsl:attribute name="Type">Edm.String</xsl:attribute>
<xsl:element name="Annotation">
<xsl:attribute name="Term">Org.OData.Core.V1.Description</xsl:attribute>
<xsl:attribute name="String">Request Id as tracked internally by the service</xsl:attribute>
</xsl:element>
</xsl:element>
<xsl:element name="Property">
<xsl:attribute name="Name">client-request-id</xsl:attribute>
<xsl:attribute name="Type">Edm.String</xsl:attribute>
<xsl:element name="Annotation">
<xsl:attribute name="Term">Org.OData.Core.V1.Description</xsl:attribute>
<xsl:attribute name="String">Client request Id as sent by the client application.</xsl:attribute>
</xsl:element>
</xsl:element>
<xsl:element name="Property">
<xsl:attribute name="Name">Date</xsl:attribute>
<xsl:attribute name="Type">Edm.DateTimeOffset</xsl:attribute>
<xsl:element name="Annotation">
<xsl:attribute name="Term">Org.OData.Core.V1.Description</xsl:attribute>
<xsl:attribute name="String">Date when the error occured.</xsl:attribute>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:copy>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

0 comments on commit 935876f

Please sign in to comment.