Skip to content

Commit 569aa57

Browse files
Merge pull request #1671 from microsoft/vnext
Release Hidi
2 parents 38cb605 + b36d694 commit 569aa57

File tree

10 files changed

+312
-357
lines changed

10 files changed

+312
-357
lines changed

.azure-pipelines/ci-build.yml

Lines changed: 286 additions & 336 deletions
Large diffs are not rendered by default.

.github/workflows/sonarcloud.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,28 +52,17 @@ jobs:
5252
path: ~/.sonar/cache
5353
key: ${{ runner.os }}-sonar
5454
restore-keys: ${{ runner.os }}-sonar
55-
- name: Cache SonarCloud scanner
56-
id: cache-sonar-scanner
57-
uses: actions/cache@v4
58-
with:
59-
path: ./.sonar/scanner
60-
key: ${{ runner.os }}-sonar-scanner
61-
restore-keys: ${{ runner.os }}-sonar-scanner
6255
- name: Install SonarCloud scanner
63-
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
64-
shell: pwsh
65-
run: |
66-
New-Item -Path ./.sonar/scanner -ItemType Directory
67-
dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner
56+
run: dotnet tool install dotnet-sonarscanner --create-manifest-if-needed
6857
- name: Build and analyze
6958
env:
7059
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
7160
CollectCoverage: true
7261
CoverletOutputFormat: 'opencover' # https://github.com/microsoft/vstest/issues/4014#issuecomment-1307913682
7362
shell: pwsh
7463
run: |
75-
./.sonar/scanner/dotnet-sonarscanner begin /k:"microsoft_OpenAPI.NET" /o:"microsoft" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="test/**/coverage.opencover.xml"
64+
dotnet tool run dotnet-sonarscanner begin /k:"microsoft_OpenAPI.NET" /o:"microsoft" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="test/**/coverage.opencover.xml"
7665
dotnet workload restore
7766
dotnet build
7867
dotnet test Microsoft.OpenApi.sln --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
79-
./.sonar/scanner/dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
68+
dotnet tool run dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"

CODE_OF_CONDUCT.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Microsoft Open Source Code of Conduct
2+
3+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
4+
5+
Resources:
6+
7+
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
8+
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
9+
- Contact [[email protected]](mailto:[email protected]) with questions or concerns
10+
- Employees can reach out at [aka.ms/opensource/moderation-support](https://aka.ms/opensource/moderation-support)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,4 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope
133133
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
134134
contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
135135

136-
To provide feedback and ask questions you can use Stack Overflow with the [OpenAPI.NET](https://stackoverflow.com/questions/tagged/openapi.net) tag or use the OpenAPI.NET Slack channel which you can join by registering for the HTTP APIs team at http://slack.httpapis.com.
136+
To provide feedback and ask questions you can use Stack Overflow with the [OpenAPI.NET](https://stackoverflow.com/questions/tagged/openapi.net) tag.

src/Microsoft.OpenApi.Hidi/Microsoft.OpenApi.Hidi.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<Nullable>enable</Nullable>
1010
<ToolCommandName>hidi</ToolCommandName>
1111
<PackageOutputPath>./../../artifacts</PackageOutputPath>
12-
<Version>1.4.2</Version>
12+
<Version>1.4.3</Version>
1313
<Description>OpenAPI.NET CLI tool for slicing OpenAPI documents</Description>
1414
<SignAssembly>true</SignAssembly>
1515
<!-- https://github.com/dotnet/sourcelink/blob/main/docs/README.md#embeduntrackedsources -->
@@ -34,8 +34,8 @@
3434
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
3535
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
3636
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
37-
<PackageReference Include="Microsoft.OData.Edm" Version="7.21.0" />
38-
<PackageReference Include="Microsoft.OpenApi.OData" Version="1.6.3" />
37+
<PackageReference Include="Microsoft.OData.Edm" Version="7.21.1" />
38+
<PackageReference Include="Microsoft.OpenApi.OData" Version="1.6.4" />
3939
<PackageReference Include="Microsoft.OpenApi.ApiManifest" Version="0.5.0-preview" />
4040
<PackageReference Include="System.CommandLine.Hosting" Version="0.4.0-alpha.22272.1" />
4141
</ItemGroup>

src/Microsoft.OpenApi.Hidi/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ This command accepts the following parameters:
9595
hidi transform --openapi files\People.yml --format yaml --output files\People2.yml --version OpenApi3_0 --filterByCollection Graph-Collection-0017059134807617005.postman_collection.json
9696
9797
3. CSDL--->OpenAPI conversion and filtering
98-
hidi transform --input Files/Todo.xml --output Files/Todo-subset.yml --format yaml --version OpenApi3_0 --filterByOperationIds Todos.Todo.UpdateTodo
98+
hidi transform --csdl Files/Todo.xml --output Files/Todo-subset.yml --format yaml --version OpenApi3_0 --filterByOperationIds Todos.Todo.UpdateTodo
9999
100100
4. CSDL Filtering by EntitySets and Singletons
101101
hidi transform --cs dataverse.csdl --csdlFilter "appointments,opportunities" -o appointmentsAndOpportunities.yaml --ll trace

src/Microsoft.OpenApi.Workbench/Microsoft.OpenApi.Workbench.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</PropertyGroup>
1010
<ItemGroup>
1111
<PackageReference Include="Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers" Version="0.4.421302" PrivateAssets="all" />
12-
<PackageReference Include="Microsoft.Windows.Compatibility" Version="8.0.4" />
12+
<PackageReference Include="Microsoft.Windows.Compatibility" Version="8.0.5" />
1313
</ItemGroup>
1414
<ItemGroup>
1515
<Resource Include="Themes\Metro\HowToApplyTheme.txt" />

src/Microsoft.OpenApi/Extensions/OpenApiTypeMapper.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,11 @@ public static Type MapOpenApiPrimitiveTypeToSimpleType(this OpenApiSchema schema
100100
("boolean", null, false) => typeof(bool),
101101
("integer", "int32", false) => typeof(int),
102102
("integer", "int64", false) => typeof(long),
103+
("integer", null, false) => typeof(int),
103104
("number", "float", false) => typeof(float),
104105
("number", "double", false) => typeof(double),
105106
("number", "decimal", false) => typeof(decimal),
107+
("number", null, false) => typeof(double),
106108
("string", "byte", false) => typeof(byte),
107109
("string", "date-time", false) => typeof(DateTimeOffset),
108110
("string", "uuid", false) => typeof(Guid),
@@ -113,8 +115,10 @@ public static Type MapOpenApiPrimitiveTypeToSimpleType(this OpenApiSchema schema
113115
("string", "uri", false) => typeof(Uri),
114116
("integer", "int32", true) => typeof(int?),
115117
("integer", "int64", true) => typeof(long?),
118+
("integer", null, true) => typeof(int?),
116119
("number", "float", true) => typeof(float?),
117120
("number", "double", true) => typeof(double?),
121+
("number", null, true) => typeof(double?),
118122
("number", "decimal", true) => typeof(decimal?),
119123
("string", "byte", true) => typeof(byte?),
120124
("string", "date-time", true) => typeof(DateTimeOffset?),

test/Microsoft.OpenApi.Tests/Extensions/OpenApiTypeMapperTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ public class OpenApiTypeMapperTests
2424
public static IEnumerable<object[]> OpenApiDataTypes => new List<object[]>
2525
{
2626
new object[] { new OpenApiSchema { Type = "integer", Format = "int32"}, typeof(int) },
27+
new object[] { new OpenApiSchema { Type = "integer", Format = null, Nullable = false}, typeof(int) },
28+
new object[] { new OpenApiSchema { Type = "integer", Format = null, Nullable = true}, typeof(int?) },
2729
new object[] { new OpenApiSchema { Type = "string" }, typeof(string) },
2830
new object[] { new OpenApiSchema { Type = "number", Format = "double" }, typeof(double) },
2931
new object[] { new OpenApiSchema { Type = "number", Format = "float", Nullable = true }, typeof(float?) },

test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<PackageReference Include="Moq" Version="4.20.70" />
1616
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
1717
<PackageReference Include="SharpYaml" Version="2.1.1" />
18-
<PackageReference Include="Verify.Xunit" Version="24.1.0" />
18+
<PackageReference Include="Verify.Xunit" Version="24.2.0" />
1919
<PackageReference Include="xunit" Version="2.8.0" />
2020
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.0" PrivateAssets="all" />
2121
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />

0 commit comments

Comments
 (0)