Skip to content

Commit a680a6b

Browse files
committed
Merge remote-tracking branch 'upstream/vnext' into inline-some-out-variables
2 parents 087a533 + a05c169 commit a680a6b

File tree

352 files changed

+2264
-2744
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

352 files changed

+2264
-2744
lines changed

Directory.Build.props

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<Project>
2+
<PropertyGroup>
3+
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
4+
<Authors>Microsoft</Authors>
5+
<Company>Microsoft</Company>
6+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
7+
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
8+
<RepositoryUrl>https://github.com/Microsoft/OpenAPI.NET</RepositoryUrl>
9+
<PackageReleaseNotes>https://github.com/microsoft/OpenAPI.NET/releases</PackageReleaseNotes>
10+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
11+
<PackageIconUrl>http://go.microsoft.com/fwlink/?LinkID=288890</PackageIconUrl>
12+
<PackageProjectUrl>https://github.com/Microsoft/OpenAPI.NET</PackageProjectUrl>
13+
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
14+
<PackageTags>OpenAPI .NET</PackageTags>
15+
</PropertyGroup>
16+
<!-- https://github.com/clairernovotny/DeterministicBuilds#deterministic-builds -->
17+
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
18+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
19+
</PropertyGroup>
20+
<ItemGroup>
21+
<PackageReference
22+
Condition="!$(MSBuildProjectName.EndsWith('Tests'))"
23+
Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
24+
</ItemGroup>
25+
</Project>

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
22
WORKDIR /app
33

44
COPY ./src ./hidi/src
5+
COPY ./Directory.Build.props ./hidi/Directory.Build.props
6+
COPY ./README.md ./hidi/README.md
57
WORKDIR /app/hidi
68
RUN dotnet publish ./src/Microsoft.OpenApi.Hidi/Microsoft.OpenApi.Hidi.csproj -c Release
79

8-
FROM mcr.microsoft.com/dotnet/runtime:7.0 as runtime
10+
FROM mcr.microsoft.com/dotnet/runtime:7.0 AS runtime
911
WORKDIR /app
1012

1113
COPY --from=build-env /app/hidi/src/Microsoft.OpenApi.Hidi/bin/Release/net7.0 ./

src/Directory.Build.props

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/Microsoft.OpenApi.Hidi/Extensions/CommandExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
2-
// Licensed under the MIT license.
2+
// Licensed under the MIT license.
33

44
using System.Collections.Generic;
55
using System.CommandLine;

src/Microsoft.OpenApi.Hidi/Formatters/PowerShellFormatter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ static PowerShellFormatter()
2424
{
2525
// Add singularization exclusions.
2626
// Enhancement: Read exclusions from a user provided file.
27-
Vocabularies.Default.AddSingular("(drive)s$", "$1"); // drives does not properly singularize to drive.
27+
Vocabularies.Default.AddSingular("(drive)s$", "$1"); // drives does not properly singularize to drive.
2828
Vocabularies.Default.AddSingular("(data)$", "$1"); // exclude the following from singularization.
2929
Vocabularies.Default.AddSingular("(delta)$", "$1");
3030
Vocabularies.Default.AddSingular("(quota)$", "$1");
@@ -133,7 +133,7 @@ private static string SingularizeAndDeduplicateOperationId(IList<string> operati
133133

134134
singularizedSegments.Add(segment);
135135
}
136-
return string.Join(".", singularizedSegments);
136+
return string.Join('.', singularizedSegments);
137137
}
138138

139139
private static string RemoveHashSuffix(string operationId)
@@ -153,7 +153,7 @@ private static string RemoveKeyTypeSegment(string operationId, IList<OpenApiPara
153153
segments.Remove(keyTypeExtension);
154154
}
155155
}
156-
return string.Join(".", segments);
156+
return string.Join('.', segments);
157157
}
158158

159159
private static IList<OpenApiParameter> ResolveFunctionParameters(IList<OpenApiParameter> parameters)

src/Microsoft.OpenApi.Hidi/Logger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static ILoggerFactory ConfigureLogger(LogLevel logLevel)
2121
{
2222
c.IncludeScopes = true;
2323
})
24-
#if DEBUG
24+
#if DEBUG
2525
.AddDebug()
2626
#endif
2727
.SetMinimumLevel(logLevel);

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,14 @@
77
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
88
<PackAsTool>true</PackAsTool>
99
<Nullable>enable</Nullable>
10-
<PackageIconUrl>http://go.microsoft.com/fwlink/?LinkID=288890</PackageIconUrl>
11-
<PackageProjectUrl>https://github.com/Microsoft/OpenAPI.NET</PackageProjectUrl>
12-
<PackageLicenseExpression>MIT</PackageLicenseExpression>
13-
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
14-
<Authors>Microsoft</Authors>
15-
<Company>Microsoft</Company>
16-
<Title>Microsoft.OpenApi.Hidi</Title>
17-
<PackageId>Microsoft.OpenApi.Hidi</PackageId>
1810
<ToolCommandName>hidi</ToolCommandName>
1911
<PackageOutputPath>./../../artifacts</PackageOutputPath>
2012
<Version>1.3.0</Version>
2113
<Description>OpenAPI.NET CLI tool for slicing OpenAPI documents</Description>
22-
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
23-
<PackageTags>OpenAPI .NET</PackageTags>
24-
<RepositoryUrl>https://github.com/Microsoft/OpenAPI.NET</RepositoryUrl>
25-
<PackageReleaseNotes>https://github.com/microsoft/OpenAPI.NET/releases</PackageReleaseNotes>
26-
<AssemblyName>Microsoft.OpenApi.Hidi</AssemblyName>
27-
<RootNamespace>Microsoft.OpenApi.Hidi</RootNamespace>
2814
<SignAssembly>true</SignAssembly>
2915
<!-- https://github.com/dotnet/sourcelink/blob/main/docs/README.md#embeduntrackedsources -->
3016
<EmbedUntrackedSources>true</EmbedUntrackedSources>
3117
<NoWarn>$(NoWarn);NU5048;NU5104;CA1848;</NoWarn>
32-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
3318
<PackageReadmeFile>readme.md</PackageReadmeFile>
3419
<AnalysisMode>All</AnalysisMode>
3520
</PropertyGroup>

src/Microsoft.OpenApi.Hidi/OpenApiService.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ private static OpenApiDocument ApplyFilters(HidiOptions options, ILogger logger,
154154
requestUrls = EnumerateJsonDocument(postmanCollection.RootElement, new());
155155
logger.LogTrace("Finished fetching the list of paths and Http methods defined in the Postman collection.");
156156
}
157-
else
157+
else
158158
{
159159
requestUrls = new();
160160
logger.LogTrace("No filter options provided.");
@@ -211,10 +211,9 @@ private static void WriteOpenApi(HidiOptions options, OpenApiFormat openApiForma
211211
}
212212
}
213213

214-
// Get OpenAPI document either from OpenAPI or CSDL
214+
// Get OpenAPI document either from OpenAPI or CSDL
215215
private static async Task<OpenApiDocument> GetOpenApi(HidiOptions options, ILogger logger, string? metadataVersion = null, CancellationToken cancellationToken = default)
216216
{
217-
218217
OpenApiDocument document;
219218
Stream stream;
220219

@@ -285,7 +284,7 @@ private static async Task<OpenApiDocument> GetOpenApi(HidiOptions options, ILogg
285284

286285
private static Dictionary<string, List<string>> GetRequestUrlsFromManifest(ApiDependency apiDependency)
287286
{
288-
// Get the request URLs from the API Dependencies in the API manifest
287+
// Get the request URLs from the API Dependencies in the API manifest
289288
var requests = apiDependency
290289
.Requests.Where(static r => !r.Exclude && !string.IsNullOrEmpty(r.UriTemplate) && !string.IsNullOrEmpty(r.Method))
291290
.Select(static r => new { UriTemplate = r.UriTemplate!, Method = r.Method! })

src/Microsoft.OpenApi.Hidi/OpenApiSpecVersionHelper.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ public static OpenApiSpecVersion TryParseOpenApiSpecVersion(string value)
1818

1919
if (int.TryParse(res, out int result))
2020
{
21-
2221
if (result >= 2 && result < 3)
2322
{
2423
return OpenApiSpecVersion.OpenApi2_0;

src/Microsoft.OpenApi.Hidi/Options/CommandOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,6 @@ public IReadOnlyList<Option> GetPluginCommandOptions()
104104
LogLevelOption
105105
};
106106
}
107-
108107
}
108+
109109
}

0 commit comments

Comments
 (0)