Skip to content

Commit 1e6b115

Browse files
author
Gary Woodfine
committed
Update API references and build configurations
Several updates have been made in this commit. Argument string defaults have been set for both 'nuget_api_key' and 'github_token' in build.cake. A configuration for 'Release' has been added in 'build-deploy.yml'. Also, the key 'application/json-patch+json' has been replaced with the constant 'MediaTypeNames.Application.JsonPatch' in JsonPatchDocumentFilter.cs across multiple solutions.
1 parent 0053d7f commit 1e6b115

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

.github/workflows/build-deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ jobs:
2424
arguments: |
2525
nuget_api_key: ${{ secrets.NUGET_API_KEY }}
2626
github_token: ${{ github.token }}
27+
configuration: Release
2728

build.cake

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
var target = Argument("target", "Default");
44
var configuration = Argument("configuration", "Release");
5-
var nuget_api_key = Argument<string>("nuget_api_key");
6-
var github_token = Argument<string>("github_token");
5+
var nuget_api_key = Argument<string>("nuget_api_key" , "");
6+
var github_token = Argument<string>("github_token", "");
77

88
string version = String.Empty;
99
//////////////////////////////////////////////////////////////////////
@@ -121,9 +121,6 @@ Task("PublishNuget")
121121
}
122122
}
123123
});
124-
125-
126-
127124
//////////////////////////////////////////////////////////////////////
128125
// EXECUTION
129126
//////////////////////////////////////////////////////////////////////

src/Solution-MSSQL/src/Api/Helpers/JsonPatchDocumentFilter.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Microsoft.OpenApi.Models;
1+
using System.Net.Mime;
2+
using Microsoft.OpenApi.Models;
23
using Swashbuckle.AspNetCore.SwaggerGen;
34

45
public class JsonPatchDocumentFilter : IDocumentFilter
@@ -33,10 +34,10 @@ public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
3334
foreach (var path in swaggerDoc.Paths.SelectMany(p => p.Value.Operations)
3435
.Where(p => p.Key == Microsoft.OpenApi.Models.OperationType.Patch))
3536
{
36-
foreach (var item in path.Value.RequestBody.Content.Where(c => c.Key != "application/json-patch+json"))
37+
foreach (var item in path.Value.RequestBody.Content.Where(c => c.Key != MediaTypeNames.Application.JsonPatch))
3738
path.Value.RequestBody.Content.Remove(item.Key);
3839

39-
var response = path.Value.RequestBody.Content.SingleOrDefault(c => c.Key == "application/json-patch+json");
40+
var response = path.Value.RequestBody.Content.SingleOrDefault(c => c.Key == MediaTypeNames.Application.JsonPatch);
4041

4142
response.Value.Schema = new OpenApiSchema
4243
{

src/Solution-Postgre/src/Api/Helpers/JsonPatchDocumentFilter.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Microsoft.OpenApi.Models;
1+
using System.Net.Mime;
2+
using Microsoft.OpenApi.Models;
23
using Swashbuckle.AspNetCore.SwaggerGen;
34

45
public class JsonPatchDocumentFilter : IDocumentFilter
@@ -33,10 +34,10 @@ public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
3334
foreach (var path in swaggerDoc.Paths.SelectMany(p => p.Value.Operations)
3435
.Where(p => p.Key == Microsoft.OpenApi.Models.OperationType.Patch))
3536
{
36-
foreach (var item in path.Value.RequestBody.Content.Where(c => c.Key != "application/json-patch+json"))
37+
foreach (var item in path.Value.RequestBody.Content.Where(c => c.Key != MediaTypeNames.Application.JsonPatch))
3738
path.Value.RequestBody.Content.Remove(item.Key);
3839

39-
var response = path.Value.RequestBody.Content.SingleOrDefault(c => c.Key == "application/json-patch+json");
40+
var response = path.Value.RequestBody.Content.SingleOrDefault(c => c.Key == MediaTypeNames.Application.JsonPatch);
4041

4142
response.Value.Schema = new OpenApiSchema
4243
{

src/Solution/src/Api/Helpers/JsonPatchDocumentFilter.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Microsoft.OpenApi.Models;
1+
using System.Net.Mime;
2+
using Microsoft.OpenApi.Models;
23
using Swashbuckle.AspNetCore.SwaggerGen;
34

45
public class JsonPatchDocumentFilter : IDocumentFilter
@@ -33,10 +34,10 @@ public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
3334
foreach (var path in swaggerDoc.Paths.SelectMany(p => p.Value.Operations)
3435
.Where(p => p.Key == Microsoft.OpenApi.Models.OperationType.Patch))
3536
{
36-
foreach (var item in path.Value.RequestBody.Content.Where(c => c.Key != "application/json-patch+json"))
37+
foreach (var item in path.Value.RequestBody.Content.Where(c => c.Key != MediaTypeNames.Application.JsonPatch))
3738
path.Value.RequestBody.Content.Remove(item.Key);
3839

39-
var response = path.Value.RequestBody.Content.SingleOrDefault(c => c.Key == "application/json-patch+json");
40+
var response = path.Value.RequestBody.Content.SingleOrDefault(c => c.Key == MediaTypeNames.Application.JsonPatch);
4041

4142
response.Value.Schema = new OpenApiSchema
4243
{

0 commit comments

Comments
 (0)