Azure / Azure/azure-functions-openapi-extension

Use the Options pattern for configuring IOpenApiConfigurationOptions

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

Description

Would it be possible to register IOpenApiConfigurationOptions as an instance of IOptions so it can be configured liked this:

```csharp
builder.Services.Configure(options =>
{
options.Info.Title = "My API";
});
```

You should also be able to configure it using the existing [configuration providers](https://docs.microsoft.com/en-us/dotnet/core/extensions/configuration-providers).

I think this is more typical for configuring options in ASP.NET than the environment variable or inheritance approaches that are currently supported.

Contributor guide

Open the contributing guide

Research direction

Start by locating where IOpenApiConfigurationOptions is registered and how the existing environment-variable or inheritance approaches configure it. Compare that path with the linked .NET configuration providers and the Configure example; done means both configuration styles can supply the options.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.