Skip to content

Commit 79fe469

Browse files
committed
Reverting OpenAPI change
1 parent 062b180 commit 79fe469

File tree

4 files changed

+3
-54
lines changed

4 files changed

+3
-54
lines changed

Functions.Templates/Templates/HttpTrigger-CSharp/.template.config/template.json

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@
4040
],
4141
"replaces": "AuthLevelValue",
4242
"defaultValue": "Function"
43-
},
44-
"enableOpenApiSupport": {
45-
"type": "parameter",
46-
"datatype": "bool",
47-
"defaultValue": "false",
48-
"description": "Enable Open Api Support"
4943
}
5044
},
5145
"primaryOutputs": [
@@ -55,26 +49,6 @@
5549
],
5650
"defaultName": "HttpTriggerCSharp",
5751
"postActions": [
58-
{
59-
"condition": "enableOpenApiSupport",
60-
"Description": "Adding Reference to Microsoft.Azure.WebJobs.Extensions.OpenApi NuGet package",
61-
"ActionId": "B17581D1-C5C9-4489-8F0A-004BE667B814",
62-
"ContinueOnError": "true",
63-
"ManualInstructions": [],
64-
"args": {
65-
"referenceType": "package",
66-
"reference": "Microsoft.Azure.WebJobs.Extensions.OpenApi",
67-
"version": "0.5.1-preview",
68-
"projectFileExtensions": ".csproj"
69-
}
70-
},
71-
{
72-
"condition": "enableOpenApiSupport",
73-
"description": "Restore NuGet packages required by this project.",
74-
"manualInstructions": [],
75-
"actionId": "210D431B-A78B-4D2F-B762-4ED3E3EA9025",
76-
"continueOnError": true
77-
},
7852
{
7953
"condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
8054
"description": "Opens the function class file in the editor",

Functions.Templates/Templates/HttpTrigger-CSharp/.template.config/vs-2017.3.host.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,6 @@
2424
"package": "{E9BCFE2B-304A-4D7F-836F-F3A4FB1A1451}"
2525
},
2626
"isVisible": true
27-
},
28-
{
29-
"id": "enableOpenApiSupport",
30-
"name": {
31-
"id": "2053",
32-
"text": "Enable OpenAPI Support",
33-
"package": "{E9BCFE2B-304A-4D7F-836F-F3A4FB1A1451}"
34-
},
35-
"isVisible": true
3627
}
3728
]
3829
}
Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,18 @@
1+
using System;
12
using System.IO;
2-
#if (enableOpenApiSupport)
3-
using System.Net;
4-
#endif
53
using System.Threading.Tasks;
6-
using Microsoft.AspNetCore.Http;
74
using Microsoft.AspNetCore.Mvc;
85
using Microsoft.Azure.WebJobs;
96
using Microsoft.Azure.WebJobs.Extensions.Http;
10-
#if (enableOpenApiSupport)
11-
using Microsoft.Azure.WebJobs.Extensions.OpenApi.Core.Attributes;
12-
using Microsoft.Azure.WebJobs.Extensions.OpenApi.Core.Enums;
13-
#endif
7+
using Microsoft.AspNetCore.Http;
148
using Microsoft.Extensions.Logging;
15-
#if (enableOpenApiSupport)
16-
using Microsoft.OpenApi.Models;
17-
#endif
189
using Newtonsoft.Json;
1910

2011
namespace Company.Function
2112
{
2213
public static class HttpTriggerCSharp
2314
{
2415
[FunctionName("HttpTriggerCSharp")]
25-
#if (enableOpenApiSupport)
26-
[OpenApiOperation(operationId: "Run", tags: new[] { "name" })]
27-
[OpenApiSecurity("function_key", SecuritySchemeType.ApiKey, Name = "code", In = OpenApiSecurityLocationType.Query)]
28-
[OpenApiParameter(name: "name", In = ParameterLocation.Query, Required = true, Type = typeof(string), Description = "The **Name** parameter")]
29-
[OpenApiResponseWithBody(statusCode: HttpStatusCode.OK, contentType: "text/plain", bodyType: typeof(string), Description = "The OK response")]
30-
#endif
3116
public static async Task<IActionResult> Run(
3217
[HttpTrigger(AuthorizationLevel.AuthLevelValue, "get", "post", Route = null)] HttpRequest req,
3318
ILogger log)
@@ -48,4 +33,3 @@ public static async Task<IActionResult> Run(
4833
}
4934
}
5035
}
51-

Functions.Templates/Templates/HttpTrigger-CSharp/HttpTriggerCSharp.csx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ public static async Task<IActionResult> Run(HttpRequest req, ILogger log)
2020
: $"Hello, {name}. This HTTP triggered function executed successfully.";
2121

2222
return new OkObjectResult(responseMessage);
23-
}
23+
}

0 commit comments

Comments
 (0)