Skip to content

Commit c382c22

Browse files
Merge pull request #997 from microsoft/vnext
Release libs v1.4.0-preview3
2 parents 03ff377 + cf77bb7 commit c382c22

26 files changed

+346
-136
lines changed

.azure-pipelines/ci-build.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ stages:
266266
echo "$artifactName"
267267
echo "$artifactVersion"
268268
displayName: 'Fetch Artifact Name'
269-
270269
- task: NuGetCommand@2
271270
displayName: 'NuGet push'
272271
inputs:
@@ -276,6 +275,7 @@ stages:
276275
publishFeedCredentials: 'OpenAPI Nuget Connection'
277276
- task: GitHubRelease@1
278277
displayName: 'GitHub release (edit)'
278+
condition: succeededOrFailed()
279279
inputs:
280280
gitHubConnection: 'Github-MaggieKimani1'
281281
action: edit
@@ -285,6 +285,12 @@ stages:
285285
releaseNotesSource: inline
286286
assets: '$(Pipeline.Workspace)\**\*.exe'
287287
changeLogType: issueBased
288+
changeLogLabels: '[
289+
{ "label" : "feature-work", "feature", "displayName" : "New Features", "state" : "closed" },
290+
{ "label" : "enhancement", "V2-Enhancement", "displayName" : "Enhancements", "state" : "closed" },
291+
{ "label" : "bug", "bug-fix", "displayName" : "Bugs", "state" : "closed" },
292+
{ "label" : "documentation", "doc", "displayName" : "Documentation", "state" : "closed"},
293+
{ "label" : "dependencies", "displayName" : "Package Updates", "state" : "closed" }]'
288294

289295
- deployment: deploy_lib
290296
dependsOn: []

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the current behavior:
15+
16+
**Expected behavior**
17+
A clear and concise description of what you expected to happen.
18+
19+
**Screenshots/Code Snippets**
20+
If applicable, add screenshots of the stack trace or a code snippet to help explain your problem.
21+
If applicable, add a link to your project
22+
23+
**Additional context**
24+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is.
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.0" />
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
1313
<PackageReference Include="Moq" Version="4.18.2" />
1414
<PackageReference Include="xunit" Version="2.4.2" />
1515
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">

src/Microsoft.OpenApi.Hidi/OpenApiService.cs

Lines changed: 1 addition & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -356,57 +356,7 @@ public static OpenApiDocument FixReferences(OpenApiDocument document)
356356

357357
return doc;
358358
}
359-
360-
private static async Task<Stream> GetStream(string input, ILogger logger)
361-
{
362-
var stopwatch = new Stopwatch();
363-
stopwatch.Start();
364-
365-
Stream stream;
366-
if (input.StartsWith("http"))
367-
{
368-
try
369-
{
370-
var httpClientHandler = new HttpClientHandler()
371-
{
372-
SslProtocols = System.Security.Authentication.SslProtocols.Tls12,
373-
};
374-
using var httpClient = new HttpClient(httpClientHandler)
375-
{
376-
DefaultRequestVersion = HttpVersion.Version20
377-
};
378-
stream = await httpClient.GetStreamAsync(input);
379-
}
380-
catch (HttpRequestException ex)
381-
{
382-
logger.LogError($"Could not download the file at {input}, reason{ex}");
383-
return null;
384-
}
385-
}
386-
else
387-
{
388-
try
389-
{
390-
var fileInput = new FileInfo(input);
391-
stream = fileInput.OpenRead();
392-
}
393-
catch (Exception ex) when (ex is FileNotFoundException ||
394-
ex is PathTooLongException ||
395-
ex is DirectoryNotFoundException ||
396-
ex is IOException ||
397-
ex is UnauthorizedAccessException ||
398-
ex is SecurityException ||
399-
ex is NotSupportedException)
400-
{
401-
logger.LogError($"Could not open the file at {input}, reason: {ex.Message}");
402-
return null;
403-
}
404-
}
405-
stopwatch.Stop();
406-
logger.LogTrace("{timestamp}ms: Read file {input}", stopwatch.ElapsedMilliseconds, input);
407-
return stream;
408-
}
409-
359+
410360
/// <summary>
411361
/// Takes in a file stream, parses the stream into a JsonDocument and gets a list of paths and Http methods
412362
/// </summary>
@@ -462,34 +412,6 @@ private static Dictionary<string, List<string>> EnumerateJsonDocument(JsonElemen
462412
return paths;
463413
}
464414

465-
/// <summary>
466-
/// Fixes the references in the resulting OpenApiDocument.
467-
/// </summary>
468-
/// <param name="document"> The converted OpenApiDocument.</param>
469-
/// <returns> A valid OpenApiDocument instance.</returns>
470-
// private static OpenApiDocument FixReferences2(OpenApiDocument document)
471-
// {
472-
// // This method is only needed because the output of ConvertToOpenApi isn't quite a valid OpenApiDocument instance.
473-
// // So we write it out, and read it back in again to fix it up.
474-
475-
// OpenApiDocument document;
476-
// logger.LogTrace("Parsing the OpenApi file");
477-
// var result = await new OpenApiStreamReader(new OpenApiReaderSettings
478-
// {
479-
// RuleSet = ValidationRuleSet.GetDefaultRuleSet(),
480-
// BaseUrl = new Uri(openapi)
481-
// }
482-
// ).ReadAsync(stream);
483-
484-
// document = result.OpenApiDocument;
485-
// var context = result.OpenApiDiagnostic;
486-
// var sb = new StringBuilder();
487-
// document.SerializeAsV3(new OpenApiYamlWriter(new StringWriter(sb)));
488-
// var doc = new OpenApiStringReader().Read(sb.ToString(), out _);
489-
490-
// return doc;
491-
// }
492-
493415
/// <summary>
494416
/// Reads stream from file system or makes HTTP request depending on the input string
495417
/// </summary>

src/Microsoft.OpenApi.Readers/Microsoft.OpenApi.Readers.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<Company>Microsoft</Company>
1111
<Title>Microsoft.OpenApi.Readers</Title>
1212
<PackageId>Microsoft.OpenApi.Readers</PackageId>
13-
<Version>1.4.0-preview2</Version>
13+
<Version>1.4.0-preview3</Version>
1414
<Description>OpenAPI.NET Readers for JSON and YAML documents</Description>
1515
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
1616
<PackageTags>OpenAPI .NET</PackageTags>
@@ -34,7 +34,7 @@
3434
</PropertyGroup>
3535

3636
<ItemGroup>
37-
<PackageReference Include="SharpYaml" Version="1.9.2" />
37+
<PackageReference Include="SharpYaml" Version="2.1.0" />
3838
</ItemGroup>
3939

4040
<ItemGroup>

src/Microsoft.OpenApi.Readers/OpenApiYamlDocumentReader.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ public OpenApiDocument Read(YamlDocument input, out OpenApiDiagnostic diagnostic
7979
{
8080
diagnostic.Warnings.Add(item);
8181
}
82-
8382
}
8483

8584
return document;

src/Microsoft.OpenApi.Readers/V2/OpenApiOperationDeserializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ internal static partial class OpenApiV2Deserializer
6060
"consumes", (o, n) => {
6161
var consumes = n.CreateSimpleList(s => s.GetScalarValue());
6262
if (consumes.Count > 0) {
63-
n.Context.SetTempStorage(TempStorageKeys.OperationConsumes,consumes);
63+
n.Context.SetTempStorage(TempStorageKeys.OperationConsumes,consumes);
6464
}
6565
}
6666
},

src/Microsoft.OpenApi.Readers/V2/OpenApiV2VersionService.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -107,30 +107,6 @@ private static ReferenceType ParseReferenceType(string referenceTypeName)
107107
}
108108
}
109109

110-
private static string GetReferenceTypeV2Name(ReferenceType referenceType)
111-
{
112-
switch (referenceType)
113-
{
114-
case ReferenceType.Schema:
115-
return "definitions";
116-
117-
case ReferenceType.Parameter:
118-
return "parameters";
119-
120-
case ReferenceType.Response:
121-
return "responses";
122-
123-
case ReferenceType.Tag:
124-
return "tags";
125-
126-
case ReferenceType.SecurityScheme:
127-
return "securityDefinitions";
128-
129-
default:
130-
throw new ArgumentException();
131-
}
132-
}
133-
134110
private static ReferenceType GetReferenceTypeV2FromName(string referenceType)
135111
{
136112
switch (referenceType)

src/Microsoft.OpenApi/Microsoft.OpenApi.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<Company>Microsoft</Company>
1212
<Title>Microsoft.OpenApi</Title>
1313
<PackageId>Microsoft.OpenApi</PackageId>
14-
<Version>1.4.0-preview2</Version>
14+
<Version>1.4.0-preview3</Version>
1515
<Description>.NET models with JSON and YAML writers for OpenAPI specification</Description>
1616
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
1717
<PackageTags>OpenAPI .NET</PackageTags>

0 commit comments

Comments
 (0)