Skip to content

Commit

Permalink
Merge pull request #1671 from microsoft/vnext
Browse files Browse the repository at this point in the history
Release Hidi
  • Loading branch information
millicentachieng authored May 22, 2024
2 parents 38cb605 + b36d694 commit 569aa57
Show file tree
Hide file tree
Showing 10 changed files with 312 additions and 357 deletions.
622 changes: 286 additions & 336 deletions .azure-pipelines/ci-build.yml

Large diffs are not rendered by default.

17 changes: 3 additions & 14 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,28 +52,17 @@ jobs:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache SonarCloud scanner
id: cache-sonar-scanner
uses: actions/cache@v4
with:
path: ./.sonar/scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner
- name: Install SonarCloud scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
shell: pwsh
run: |
New-Item -Path ./.sonar/scanner -ItemType Directory
dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner
run: dotnet tool install dotnet-sonarscanner --create-manifest-if-needed
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
CollectCoverage: true
CoverletOutputFormat: 'opencover' # https://github.com/microsoft/vstest/issues/4014#issuecomment-1307913682
shell: pwsh
run: |
./.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"
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"
dotnet workload restore
dotnet build
dotnet test Microsoft.OpenApi.sln --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
./.sonar/scanner/dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
dotnet tool run dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
10 changes: 10 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Microsoft Open Source Code of Conduct

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).

Resources:

- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
- Employees can reach out at [aka.ms/opensource/moderation-support](https://aka.ms/opensource/moderation-support)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,4 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

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.
To provide feedback and ask questions you can use Stack Overflow with the [OpenAPI.NET](https://stackoverflow.com/questions/tagged/openapi.net) tag.
6 changes: 3 additions & 3 deletions src/Microsoft.OpenApi.Hidi/Microsoft.OpenApi.Hidi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Nullable>enable</Nullable>
<ToolCommandName>hidi</ToolCommandName>
<PackageOutputPath>./../../artifacts</PackageOutputPath>
<Version>1.4.2</Version>
<Version>1.4.3</Version>
<Description>OpenAPI.NET CLI tool for slicing OpenAPI documents</Description>
<SignAssembly>true</SignAssembly>
<!-- https://github.com/dotnet/sourcelink/blob/main/docs/README.md#embeduntrackedsources -->
Expand All @@ -34,8 +34,8 @@
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageReference Include="Microsoft.OData.Edm" Version="7.21.0" />
<PackageReference Include="Microsoft.OpenApi.OData" Version="1.6.3" />
<PackageReference Include="Microsoft.OData.Edm" Version="7.21.1" />
<PackageReference Include="Microsoft.OpenApi.OData" Version="1.6.4" />
<PackageReference Include="Microsoft.OpenApi.ApiManifest" Version="0.5.0-preview" />
<PackageReference Include="System.CommandLine.Hosting" Version="0.4.0-alpha.22272.1" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.OpenApi.Hidi/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ This command accepts the following parameters:
hidi transform --openapi files\People.yml --format yaml --output files\People2.yml --version OpenApi3_0 --filterByCollection Graph-Collection-0017059134807617005.postman_collection.json
3. CSDL--->OpenAPI conversion and filtering
hidi transform --input Files/Todo.xml --output Files/Todo-subset.yml --format yaml --version OpenApi3_0 --filterByOperationIds Todos.Todo.UpdateTodo
hidi transform --csdl Files/Todo.xml --output Files/Todo-subset.yml --format yaml --version OpenApi3_0 --filterByOperationIds Todos.Todo.UpdateTodo
4. CSDL Filtering by EntitySets and Singletons
hidi transform --cs dataverse.csdl --csdlFilter "appointments,opportunities" -o appointmentsAndOpportunities.yaml --ll trace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers" Version="0.4.421302" PrivateAssets="all" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="8.0.4" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="8.0.5" />
</ItemGroup>
<ItemGroup>
<Resource Include="Themes\Metro\HowToApplyTheme.txt" />
Expand Down
4 changes: 4 additions & 0 deletions src/Microsoft.OpenApi/Extensions/OpenApiTypeMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,11 @@ public static Type MapOpenApiPrimitiveTypeToSimpleType(this OpenApiSchema schema
("boolean", null, false) => typeof(bool),
("integer", "int32", false) => typeof(int),
("integer", "int64", false) => typeof(long),
("integer", null, false) => typeof(int),
("number", "float", false) => typeof(float),
("number", "double", false) => typeof(double),
("number", "decimal", false) => typeof(decimal),
("number", null, false) => typeof(double),
("string", "byte", false) => typeof(byte),
("string", "date-time", false) => typeof(DateTimeOffset),
("string", "uuid", false) => typeof(Guid),
Expand All @@ -113,8 +115,10 @@ public static Type MapOpenApiPrimitiveTypeToSimpleType(this OpenApiSchema schema
("string", "uri", false) => typeof(Uri),
("integer", "int32", true) => typeof(int?),
("integer", "int64", true) => typeof(long?),
("integer", null, true) => typeof(int?),
("number", "float", true) => typeof(float?),
("number", "double", true) => typeof(double?),
("number", null, true) => typeof(double?),
("number", "decimal", true) => typeof(decimal?),
("string", "byte", true) => typeof(byte?),
("string", "date-time", true) => typeof(DateTimeOffset?),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public class OpenApiTypeMapperTests
public static IEnumerable<object[]> OpenApiDataTypes => new List<object[]>
{
new object[] { new OpenApiSchema { Type = "integer", Format = "int32"}, typeof(int) },
new object[] { new OpenApiSchema { Type = "integer", Format = null, Nullable = false}, typeof(int) },
new object[] { new OpenApiSchema { Type = "integer", Format = null, Nullable = true}, typeof(int?) },
new object[] { new OpenApiSchema { Type = "string" }, typeof(string) },
new object[] { new OpenApiSchema { Type = "number", Format = "double" }, typeof(double) },
new object[] { new OpenApiSchema { Type = "number", Format = "float", Nullable = true }, typeof(float?) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="SharpYaml" Version="2.1.1" />
<PackageReference Include="Verify.Xunit" Version="24.1.0" />
<PackageReference Include="Verify.Xunit" Version="24.2.0" />
<PackageReference Include="xunit" Version="2.8.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
Expand Down

0 comments on commit 569aa57

Please sign in to comment.