Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion scripts/run-metadata-validation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $snapshot = Join-Path $repoDirectory "$($version)_metadata.xml"
$transformed = Join-Path $repoDirectory "transformed_$($version)_metadata.xml"

Write-Host "Tranforming $snapshot metadata using xslt with parameters used in the OpenAPI flow..." -ForegroundColor Green
& $transformScript -xslPath $xsltPath -inputPath $snapshot -outputPath $transformed -addInnerErrorDescription $true -removeCapabilityAnnotations $false
& $transformScript -xslPath $xsltPath -inputPath $snapshot -outputPath $transformed -addInnerErrorDescription $true -removeCapabilityAnnotations $false -csdlVersion $version

Write-Host "Validating $transformed metadata after the transform..." -ForegroundColor Green
& dotnet tool install Microsoft.OpenApi.Hidi -g --prerelease
Expand Down
1 change: 1 addition & 0 deletions transforms/csdl/preprocess_csdl.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<xsl:strip-space elements="*"/> <!-- Remove empty space after deletions. -->
<xsl:param name="remove-capability-annotations">True</xsl:param>
<xsl:param name="add-innererror-description">False</xsl:param>
<xsl:param name="csdlVersion">v1_0</xsl:param>

<!-- Flag to signal if we are generating a document for Kiota-based open api generation. -->
<xsl:variable name="open-api-generation">
Expand Down
7 changes: 5 additions & 2 deletions transforms/csdl/transform.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ param (
[bool]
$removeCapabilityAnnotations = $true,
[bool]
$addInnerErrorDescription = $false
$addInnerErrorDescription = $false,
[string]
$csdlVersion = $v1_0
)
function Get-PathWithPrefix([string]$requestedPath) {
if ([System.IO.Path]::IsPathRooted($requestedPath)) {
Expand All @@ -40,6 +42,7 @@ $outputFullPath = Get-PathWithPrefix -requestedPath $outputPath
$xsltargs = [System.Xml.Xsl.XsltArgumentList]::new()
$xsltargs.AddParam("remove-capability-annotations", "", $removeCapabilityAnnotations.ToString())
$xsltargs.AddParam("add-innererror-description", "", $addInnerErrorDescription.ToString())
$xsltargs.AddParam("csdlVersion", "", $csdlVersion)

$xmlWriterSettings = [System.Xml.XmlWriterSettings]::new()
$xmlWriterSettings.Indent = $true
Expand All @@ -56,4 +59,4 @@ catch {
}
finally {
$xmlWriter.Close()
}
}