Azure / Azure/azure-functions-openapi-extension

Are people seriously using this in production code?

Open
#350 14 comments 11 reactions 0 assignees View on GitHub
discussion enhancement
Dominant language
C#
Stars
388
Forks
202
PR merge metrics
No merged PRs in 30d

Description

I don't mean to be mean or disrespectful, but looking at the examples such as:

```
// Add these three attribute classes below
[OpenApiOperation(operationId: "greeting", tags: new[] { "greeting" }, Summary = "Greetings", Description = "This shows a welcome message.", Visibility = OpenApiVisibilityType.Important)]
[OpenApiSecurity("function_key", SecuritySchemeType.ApiKey, Name = "code", In = OpenApiSecurityLocationType.Query)]
[OpenApiParameter("name", Type = typeof(string), In = ParameterLocation.Query, Visibility = OpenApiVisibilityType.Important)]
[OpenApiResponseWithBody(statusCode: HttpStatusCode.OK, contentType: "application/json", bodyType: typeof(Greeting), Summary = "The response", Description = "This returns the response")]

[Function("Net60HttpTrigger")]
public static async Task Run([HttpTrigger(AuthorizationLevel.Function, "get", Route = "greetings")] HttpRequestData req,
FunctionContext executionContext)
{
}
```

Besides being a hard to read these are horrible to maintain. In previous versions when one could use swagger the documentation was made from what was actually in the code. With the above everything from the request parameters to the response data is in attributes. How long is it going to take before one of those is out of sync with the actual request parameters or response types.

I mean this might be fine for a hello world or some simple one developer site with few requests.. But for a normal sized site with multiple developers and 100s or more different methods being exposed.. This will just be one big mess.

I tried to see if there is some type of roadmap where auto generation of the specifications is in the future (which I dearly hope) but I could not find anything about that.

.. or am I missing some big point here which makes this all very useful?

Contributor guide

Open the contributing guide

Research direction

The issue names no files, tests, or entry points. First review the current OpenAPI attribute-based approach and any project roadmap, then clarify whether automatic specification generation is in scope; done would mean request parameters and response types stay synchronized without manually duplicating them in attributes.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp, openapi
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.