Comments (6)
We are also encountering the same issue.
from azure-functions-openapi-extension.
Edit: after checking how ...Http.AspNetCore returns errors for how HttpRequestData.Url is handled (it has thrown a UriFormatException), I found that the currently latest commit (Azure/azure-functions-dotnet-worker@bf56b37) might attempting to solve this issue.
We have also been dealing with the what could be the same problem for 2 days now. When going to "http://localhost:{port}/api/swagger.json" or "/api/swagger/ui" we get the error message below. It states One or more errors occurred. (Invalid URI: The URI is empty.)
.
Our best guess is that it's due to ConfigureAspNetCoreIntegration
in https://github.com/Azure/azure-functions-dotnet-worker/blob/main/extensions/Worker.Extensions.Http.AspNetCore/src/FunctionsHostBuilderExtensions.cs
Here it's stated webBuilder.UseUrls(HttpUriProvider.HttpUriString);
and HttpUriProvider
is implemented as a string backed by a Lazy Uri in https://github.com/Azure/azure-functions-dotnet-worker/blob/main/extensions/Worker.Extensions.Http.AspNetCore/src/HttpUriProvider.cs
But we actually do not know what Uri is supposed to be read at Microsoft.Azure.Functions.Worker.Extensions.OpenApi.HttpRequestObject..ctor
. https://github.com/Azure/azure-functions-openapi-extension/blob/main/src/Microsoft.Azure.Functions.Worker.Extensions.OpenApi/HttpRequestObject.cs
The open api generation actually works fine if I don't use ConfigureFunctionsWebApplication
and instead uses ConfigureFunctionsWorkerDefaults
but this contradicts with what is stated here: https://learn.microsoft.com/en-us/azure/azure-functions/dotnet-isolated-process-guide#aspnet-core-integration
[2023-10-31T14:42:56.448Z] swagger.json was requested.
[2023-10-31T14:42:56.490Z] Function 'RenderSwaggerDocument', Invocation id 'c21663e9-7129-4b63-a9b7-8c85dd259aa6': An exception was thrown by the invocation.
[2023-10-31T14:42:56.492Z] Result: Function 'RenderSwaggerDocument', Invocation id 'c21663e9-7129-4b63-a9b7-8c85dd259aa6': An exception was thrown by the invocation.
Exception: System.AggregateException: One or more errors occurred. (Invalid URI: The URI is empty.)
[2023-10-31T14:42:56.493Z] ---> System.UriFormatException: Invalid URI: The URI is empty.
[2023-10-31T14:42:56.493Z] at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions& creationOptions)
[2023-10-31T14:42:56.494Z] at System.Uri..ctor(String uriString)
[2023-10-31T14:42:56.495Z] at Microsoft.Azure.Functions.Worker.GrpcHttpRequestData.get_Url() in D:\a\_work\1\s\src\DotNetWorker.Grpc\Http\GrpcHttpRequestData.cs:line 101
[2023-10-31T14:42:56.496Z] at Microsoft.Azure.Functions.Worker.Extensions.OpenApi.HttpRequestObject..ctor(HttpRequestData req)
[2023-10-31T14:42:56.497Z] at Microsoft.Azure.Functions.Worker.Extensions.OpenApi.Functions.OpenApiTriggerFunction.RenderSwaggerDocument(HttpRequestData req, String extension, FunctionContext ctx)
[2023-10-31T14:42:56.498Z] at Microsoft.Azure.Functions.Worker.Extensions.OpenApi.DefaultOpenApiHttpTrigger.RenderSwaggerDocument(HttpRequestData req, String extension, FunctionContext ctx)
[2023-10-31T14:42:56.499Z] --- End of inner exception stack trace ---
[2023-10-31T14:42:56.501Z] at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
[2023-10-31T14:42:56.502Z] at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
[2023-10-31T14:42:56.503Z] at System.Threading.Tasks.Task1.get_Result()
[2023-10-31T14:42:56.504Z] at Microsoft.Azure.Functions.Worker.Invocation.DefaultFunctionInvoker2.<>c.<InvokeAsync>b__6_0(Task1 t) in D:\a\_work\1\s\src\DotNetWorker.Core\Invocation\DefaultFunctionInvoker.cs:line 32
[2023-10-31T14:42:56.505Z] at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke()
[2023-10-31T14:42:56.506Z] at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj)
[2023-10-31T14:42:56.506Z] at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
[2023-10-31T14:42:56.507Z] --- End of stack trace from previous location ---
[2023-10-31T14:42:56.508Z] at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
[2023-10-31T14:42:56.508Z] at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
[2023-10-31T14:42:56.509Z] --- End of stack trace from previous location ---
[2023-10-31T14:42:56.510Z] at Microsoft.Azure.Functions.Worker.Invocation.DefaultFunctionExecutor.ExecuteAsync(FunctionContext context) in D:\a\_work\1\s\src\DotNetWorker.Core\Invocation\DefaultFunctionExecutor.cs:line 45
[2023-10-31T14:42:56.515Z] at Microsoft.Azure.Functions.Worker.OutputBindings.OutputBindingsMiddleware.Invoke(FunctionContext context, FunctionExecutionDelegate next) in D:\a\_work\1\s\src\DotNetWorker.Core\OutputBindings\OutputBindingsMiddleware.cs:line 13
[2023-10-31T14:42:56.516Z] at Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore.FunctionsHttpProxyingMiddleware.Invoke(FunctionContext context, FunctionExecutionDelegate next) in D:\a\_work\1\s\extensions\Worker.Extensions.Http.AspNetCore\src\FunctionsMiddleware\FunctionsHttpProxyingMiddleware.cs:line 48
[2023-10-31T14:42:56.517Z] at Microsoft.Azure.Functions.Worker.FunctionsApplication.InvokeFunctionAsync(FunctionContext context) in D:\a\_work\1\s\src\DotNetWorker.Core\FunctionsApplication.cs:line 77
Stack: at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
[2023-10-31T14:42:56.518Z] at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
[2023-10-31T14:42:56.521Z] at System.Threading.Tasks.Task1.get_Result()
[2023-10-31T14:42:56.522Z] at Microsoft.Azure.Functions.Worker.Invocation.DefaultFunctionInvoker2.<>c.<InvokeAsync>b__6_0(Task1 t) in D:\a\_work\1\s\src\DotNetWorker.Core\Invocation\DefaultFunctionInvoker.cs:line 32
[2023-10-31T14:42:56.523Z] at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke()
[2023-10-31T14:42:56.523Z] at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj)
[2023-10-31T14:42:56.524Z] at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
[2023-10-31T14:42:56.525Z] --- End of stack trace from previous location ---
[2023-10-31T14:42:56.525Z] at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
[2023-10-31T14:42:56.528Z] at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
[2023-10-31T14:42:56.529Z] --- End of stack trace from previous location ---
[2023-10-31T14:42:56.531Z] at Microsoft.Azure.Functions.Worker.Invocation.DefaultFunctionExecutor.ExecuteAsync(FunctionContext context) in D:\a\_work\1\s\src\DotNetWorker.Core\Invocation\DefaultFunctionExecutor.cs:line 45
[2023-10-31T14:42:56.535Z] at Microsoft.Azure.Functions.Worker.OutputBindings.OutputBindingsMiddleware.Invoke(FunctionContext context, FunctionExecutionDelegate next) in D:\a\_work\1\s\src\DotNetWorker.Core\OutputBindings\OutputBindingsMiddleware.cs:line 13
[2023-10-31T14:42:56.539Z] at Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore.FunctionsHttpProxyingMiddleware.Invoke(FunctionContext context, FunctionExecutionDelegate next) in D:\a\_work\1\s\extensions\Worker.Extensions.Http.AspNetCore\src\FunctionsMiddleware\FunctionsHttpProxyingMiddleware.cs:line 48
[2023-10-31T14:42:56.540Z] Executed 'Functions.RenderSwaggerDocument' (Failed, Id=c21663e9-7129-4b63-a9b7-8c85dd259aa6, Duration=400ms)
[2023-10-31T14:42:56.541Z] at Microsoft.Azure.Functions.Worker.FunctionsApplication.InvokeFunctionAsync(FunctionContext context) in D:\a\_work\1\s\src\DotNetWorker.Core\FunctionsApplication.cs:line 77.
[2023-10-31T14:42:56.544Z] System.Private.CoreLib: Exception while executing function: Functions.RenderSwaggerDocument. System.Private.CoreLib: Result: Failure
Exception: System.AggregateException: One or more errors occurred. (Invalid URI: The URI is empty.)
[2023-10-31T14:42:56.546Z] ---> System.UriFormatException: Invalid URI: The URI is empty.
[2023-10-31T14:42:56.547Z] at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions& creationOptions)
[2023-10-31T14:42:56.547Z] at System.Uri..ctor(String uriString)
[2023-10-31T14:42:56.548Z] at Microsoft.Azure.Functions.Worker.GrpcHttpRequestData.get_Url() in D:\a\_work\1\s\src\DotNetWorker.Grpc\Http\GrpcHttpRequestData.cs:line 101
[2023-10-31T14:42:56.549Z] at Microsoft.Azure.Functions.Worker.Extensions.OpenApi.HttpRequestObject..ctor(HttpRequestData req)
[2023-10-31T14:42:56.549Z] at Microsoft.Azure.Functions.Worker.Extensions.OpenApi.Functions.OpenApiTriggerFunction.RenderSwaggerDocument(HttpRequestData req, String extension, FunctionContext ctx)
[2023-10-31T14:42:56.550Z] at Microsoft.Azure.Functions.Worker.Extensions.OpenApi.DefaultOpenApiHttpTrigger.RenderSwaggerDocument(HttpRequestData req, String extension, FunctionContext ctx)
[2023-10-31T14:42:56.551Z] --- End of inner exception stack trace ---
[2023-10-31T14:42:56.552Z] at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
[2023-10-31T14:42:56.552Z] at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
[2023-10-31T14:42:56.553Z] at System.Threading.Tasks.Task1.get_Result()
[2023-10-31T14:42:56.553Z] at Microsoft.Azure.Functions.Worker.Invocation.DefaultFunctionInvoker2.<>c.<InvokeAsync>b__6_0(Task1 t) in D:\a\_work\1\s\src\DotNetWorker.Core\Invocation\DefaultFunctionInvoker.cs:line 32
[2023-10-31T14:42:56.554Z] at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke()
[2023-10-31T14:42:56.555Z] at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj)
[2023-10-31T14:42:56.556Z] at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
[2023-10-31T14:42:56.558Z] --- End of stack trace from previous location ---
[2023-10-31T14:42:56.560Z] at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
[2023-10-31T14:42:56.560Z] at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
[2023-10-31T14:42:56.561Z] --- End of stack trace from previous location ---
[2023-10-31T14:42:56.562Z] at Microsoft.Azure.Functions.Worker.Invocation.DefaultFunctionExecutor.ExecuteAsync(FunctionContext context) in D:\a\_work\1\s\src\DotNetWorker.Core\Invocation\DefaultFunctionExecutor.cs:line 45
[2023-10-31T14:42:56.563Z] at Microsoft.Azure.Functions.Worker.OutputBindings.OutputBindingsMiddleware.Invoke(FunctionContext context, FunctionExecutionDelegate next) in D:\a\_work\1\s\src\DotNetWorker.Core\OutputBindings\OutputBindingsMiddleware.cs:line 13
[2023-10-31T14:42:56.567Z] at Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore.FunctionsHttpProxyingMiddleware.Invoke(FunctionContext context, FunctionExecutionDelegate next) in D:\a\_work\1\s\extensions\Worker.Extensions.Http.AspNetCore\src\FunctionsMiddleware\FunctionsHttpProxyingMiddleware.cs:line 48
[2023-10-31T14:42:56.568Z] at Microsoft.Azure.Functions.Worker.FunctionsApplication.InvokeFunctionAsync(FunctionContext context) in D:\a\_work\1\s\src\DotNetWorker.Core\FunctionsApplication.cs:line 77
[2023-10-31T14:42:56.569Z] at Microsoft.Azure.Functions.Worker.Handlers.InvocationHandler.InvokeAsync(InvocationRequest request) in D:\a\_work\1\s\src\DotNetWorker.Grpc\Handlers\InvocationHandler.cs:line 88
Stack: at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
[2023-10-31T14:42:56.570Z] at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
[2023-10-31T14:42:56.570Z] at System.Threading.Tasks.Task1.get_Result()
[2023-10-31T14:42:56.571Z] at Microsoft.Azure.Functions.Worker.Invocation.DefaultFunctionInvoker2.<>c.<InvokeAsync>b__6_0(Task1 t) in D:\a\_work\1\s\src\DotNetWorker.Core\Invocation\DefaultFunctionInvoker.cs:line 32
[2023-10-31T14:42:56.575Z] at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke()
[2023-10-31T14:42:56.576Z] at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj)
[2023-10-31T14:42:56.577Z] at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
[2023-10-31T14:42:56.578Z] --- End of stack trace from previous location ---
[2023-10-31T14:42:56.579Z] at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
[2023-10-31T14:42:56.580Z] at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
[2023-10-31T14:42:56.580Z] --- End of stack trace from previous location ---
[2023-10-31T14:42:56.581Z] at Microsoft.Azure.Functions.Worker.Invocation.DefaultFunctionExecutor.ExecuteAsync(FunctionContext context) in D:\a\_work\1\s\src\DotNetWorker.Core\Invocation\DefaultFunctionExecutor.cs:line 45
[2023-10-31T14:42:56.582Z] at Microsoft.Azure.Functions.Worker.OutputBindings.OutputBindingsMiddleware.Invoke(FunctionContext context, FunctionExecutionDelegate next) in D:\a\_work\1\s\src\DotNetWorker.Core\OutputBindings\OutputBindingsMiddleware.cs:line 13
[2023-10-31T14:42:56.582Z] at Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore.FunctionsHttpProxyingMiddleware.Invoke(FunctionContext context, FunctionExecutionDelegate next) in D:\a\_work\1\s\extensions\Worker.Extensions.Http.AspNetCore\src\FunctionsMiddleware\FunctionsHttpProxyingMiddleware.cs:line 48
[2023-10-31T14:42:56.583Z] at Microsoft.Azure.Functions.Worker.FunctionsApplication.InvokeFunctionAsync(FunctionContext context) in D:\a\_work\1\s\src\DotNetWorker.Core\FunctionsApplication.cs:line 77
[2023-10-31T14:42:56.584Z] at Microsoft.Azure.Functions.Worker.Handlers.InvocationHandler.InvokeAsync(InvocationRequest request) in D:\a\_work\1\s\src\DotNetWorker.Grpc\Handlers\InvocationHandler.cs:line 88```
from azure-functions-openapi-extension.
+1. Also having this issue
from azure-functions-openapi-extension.
I am also having this issue with Open API extension when using ASP.Net core integration for Isolated Process Functions.
from azure-functions-openapi-extension.
+1 for the same issue. Any workaround?
from azure-functions-openapi-extension.
+1 also having this issue, currently no workaround :/
from azure-functions-openapi-extension.
Related Issues (20)
- No way to add example to a parameter definition using attributes - OpenApiParameterAttribute does not support all properties of Microsoft.OpenApi.Models OpenApiParameter
- Easy Auth enabled on Azure portal for function app not allowed to exposed Swagger endpoints
- Future of this project? HOT 6
- Adding custom attribute to the openAPI endpoints possible?
- Documentation: Update .ConfigureFunctionsWorkerDefaults(...) to be .ConfigureFunctionsWebApplication(...)
- Synchronous operations are disallowed HOT 1
- Generate OpenApi swagger at build time. HOT 1
- Swagger Serializer Settings
- Validation, is it even working ?
- ObjectTypeVisitor - cast to OpenApiSchemaAcceptor instead of IOpenApiSchemaAcceptor HOT 1
- Ignore certain enum values
- Visitors - no shortcut for recursive references causing stack overflow
- Incorrect schema generated for PATCH requests when using Microsoft.AspNetCore.JsonPatch library
- Exception thrown trying to render any endpoint from the OpenAPI endpoints HOT 4
- Feature Request: Adding `displayOperationId` to Swagger UI
- Error when rendering the Swagger UI when API includes a class that has multiple objects(16)
- Does not generate valid OpenApi 3.0.1 spec; mutually exclusive `example` and `examples` elements are both generated.
- .NET 8 Isolated example, swagger ui wont render but I see the endpoints listed in the runtime window HOT 1
- Swagger UI generation failing
- openApi is not reachable when calling from the azure HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-functions-openapi-extension.