You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/app-settings.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,3 +3,15 @@
3
3
[](https://www.nuget.org/packages/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings/)[](https://www.nuget.org/packages/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings/)
4
4
5
5
This is a base app settings environment variables deserialised. This MUST be inherited for use.
@@ -95,7 +102,71 @@ public static async Task<IActionResult> RenderSwaggerUI(
95
102
```
96
103
97
104
98
-
## App Settings ##
105
+
## Open API Metadata ##
106
+
107
+
To generate an Open API document, [OpenApiInfo object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#infoObject) needs to be defined. This information can be declared in three places –`host.json`, `openapisettings.json` or `local.settings.json`.
108
+
109
+
This library looks for the information in the following order:
110
+
111
+
1.`host.json`
112
+
2.`openapisettings.json`
113
+
3.`local.settings.json` or App Settings blade
114
+
115
+
116
+
### `host.json` ###
117
+
118
+
Although it has not been officially accepted to be a part of `host.json`, the Open API metadata still can be stored in it like:
119
+
120
+
```json
121
+
{
122
+
...
123
+
"openApi": {
124
+
"info": {
125
+
"version": "3.0.0",
126
+
"title": "Open API Sample on Azure Functions",
127
+
"description": "A sample API that runs on Azure Functions 3.x using Open API specification - from **host. json**.",
Copy file name to clipboardExpand all lines: src/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.csproj
/// This represents the resolver entity for configuration.
15
+
/// </summary>
16
+
publicstaticclassConfigurationResolver
17
+
{
18
+
/// <summary>
19
+
/// Gets the <see cref="IConfiguration"/> instance from the environment variables - either local.settings.json or App Settings blade.
20
+
/// </summary>
21
+
publicstaticIConfigurationResolve()
22
+
{
23
+
varconfig=newConfigurationBuilder()
24
+
.AddEnvironmentVariables()
25
+
.Build();
26
+
27
+
returnconfig;
28
+
}
29
+
30
+
/// <summary>
31
+
/// Gets the configuration value.
32
+
/// </summary>
33
+
/// <typeparam name="T">Type of return value.</typeparam>
34
+
/// <param name="key">Key for lookup.</param>
35
+
/// <param name="config"><see cref="IConfiguration"/> instance from the environment variables - either local.settings.json or App Settings blade.</param>
/// Gets the base path of the executing Azure Functions assembly.
51
+
/// </summary>
52
+
/// <param name="environmentVariables"><see cref="IConfiguration"/> instance representing environment variables from either local.settings.json or App Settings blade.</param>
53
+
/// <returns>Returns the base path of the executing Azure Functions assembly.</returns>
Copy file name to clipboardExpand all lines: src/Aliencube.AzureFunctions.Extensions.Configuration.Json/Aliencube.AzureFunctions.Extensions.Configuration.Json.csproj
Copy file name to clipboardExpand all lines: src/Aliencube.AzureFunctions.Extensions.DependencyInjection/Aliencube.AzureFunctions.Extensions.DependencyInjection.csproj
0 commit comments