File tree Expand file tree Collapse file tree 4 files changed +20
-7
lines changed
Expand file tree Collapse file tree 4 files changed +20
-7
lines changed Original file line number Diff line number Diff line change 3333 - name : Setup .NET
34343535 with :
36- dotnet-version : 8.0.x
36+ dotnet-version : 9.x
37+
38+ - run : dotnet tool install --global Microsoft.OpenApi.Hidi
39+ name : Install Hidi
3740
3841 - name : Validate latest XSLT rules
3942 run : ./scripts/run-metadata-validation.ps1 -repoDirectory "${{ github.workspace }}" -version "${{ matrix.version }}" -platformName "${{ matrix.settings }}"
Original file line number Diff line number Diff line change 3333 - name : Setup .NET
34343535 with :
36- dotnet-version : 8.0.x
36+ dotnet-version : 9.x
37+
38+ - run : dotnet tool install --global Microsoft.OpenApi.Hidi
39+ name : Install Hidi
40+
3741 - name : Validate latest OpenAPI docs
3842 run : ./scripts/run-openapi-validation.ps1 -repoDirectory "${{ github.workspace }}" -version "${{ matrix.version }}" -platformName "${{ matrix.settings }}"
3943 shell : pwsh
Original file line number Diff line number Diff line change @@ -26,6 +26,11 @@ if([string]::IsNullOrWhiteSpace($platformName))
2626 $platformName = " openapi"
2727}
2828
29+ $hidiResults = dotnet tool list microsoft.openapi.hidi - g -- format json | ConvertFrom-json
30+ if ($hidiResults.data.Length -lt 1 ) {
31+ throw " Hidi tool is not installed. Please install it using the command: dotnet tool install --global Microsoft.OpenApi.Hidi"
32+ }
33+
2934$transformCsdlDirectory = Join-Path $repoDirectory " transforms/csdl"
3035$transformScript = Join-Path $transformCsdlDirectory " transform.ps1"
3136$xsltPath = Join-Path $transformCsdlDirectory " preprocess_csdl.xsl"
@@ -37,12 +42,10 @@ $transformed = Join-Path $repoDirectory "transformed_$($version)_metadata.xml"
3742$yamlFilePath = Join-Path $repoDirectory " transformed_$ ( $version ) _$ ( $platformName ) _metadata.yml"
3843
3944try {
40- Write-Host " Tranforming $snapshot metadata using xslt with parameters used in the OpenAPI flow..." - ForegroundColor Green
45+ Write-Host " Transforming $snapshot metadata using xslt with parameters used in the OpenAPI flow..." - ForegroundColor Green
4146 & $transformScript - xslPath $xsltPath - inputPath $snapshot - outputPath $transformed - addInnerErrorDescription $true - removeCapabilityAnnotations $false - csdlVersion $version
4247
4348 Write-Host " Validating $transformed metadata after the transform..." - ForegroundColor Green
44- # pin the hidi version till odata to openApi conversion supports 2.0
45- & dotnet tool install -- global Microsoft.OpenApi.Hidi
4649 & hidi transform -- cs $transformed - o $yamlFilePath -- co -f Yaml -- sp " $conversionSettingsDirectory /$platformName .json"
4750
4851} catch {
Original file line number Diff line number Diff line change @@ -32,10 +32,13 @@ if([string]::IsNullOrWhiteSpace($platformName))
3232 $platformName = " openapi"
3333}
3434
35+ $hidiResults = dotnet tool list microsoft.openapi.hidi - g -- format json | ConvertFrom-json
36+ if ($hidiResults.data.Length -lt 1 ) {
37+ throw " Hidi tool is not installed. Please install it using the command: dotnet tool install --global Microsoft.OpenApi.Hidi"
38+ }
39+
3540$yaml = Join-Path $repoDirectory " openapi" $version " $platformName .yaml"
3641
3742Write-Host " Validating $yaml OpenAPI doc..." - ForegroundColor Green
3843
39- # pin the hidi version till odata to openApi conversion supports 2.0
40- & dotnet tool install -- global Microsoft.OpenApi.Hidi
4144& hidi validate - d $yaml
You can’t perform that action at this time.
0 commit comments