Comments (6)
I tried the same route with the ASP.NET Core Web API with Swashbuckle, and it worked. Looking at the generated openapi definition, it seems that "*" should not be included in the definition.
[Route("api/[controller]")]
[ApiController]
public class ValuesController : ControllerBase
{
[HttpGet("{*path}")]
public ActionResult Get(string path)
{
return Ok(path);
}
}
{
"openapi": "3.0.1",
"info": {
"title": "WebApplication6",
"version": "v1"
},
"paths": {
"/api/Values/{path}": {
"get": {
"tags": [
"Values"
],
"parameters": [
{
"name": "path",
"in": "path",
"required": true,
"schema": {
"type": "string",
"nullable": true
}
}
],
"responses": {
"200": {
"description": "Success"
}
}
}
}
},
"components": { }
}
from azure-functions-openapi-extension.
@shibayan Thanks for the issue! The actual function endpoint itself works fine, if you send a request directly to the endpoint like:
curl http://localhost:7071/api/catchall/hello/world
However, like you mentioned, I can confirm that it doesn't work on the UI as expected. I'm not sure it's the issue on my end or the UI's end.
Have you got the similar experience with Swagger UI on other application like ASP.NET Core Web API with Swashbuckle?
from azure-functions-openapi-extension.
Thanks for confirming! Let me have a look.
from azure-functions-openapi-extension.
@shibayan I looked at the issue. However, if the wildcard character is omitted, it actually changes the semantics of the endpoint. In other words, the following path template implies the {*path}
can be hello
, hello/world
or hello/world/lorem/ipsum
.
/catchall/{*path}
But the following path template implies the {path}
can only be hello
or world
, not hello/world
/catchall/{path}
I can change the path template from /catchall/{*path}
to /catchall/{path}
so that the OpenAPI doc shows the latter but, like I said, it changes semantics. Even though I applied the change to Swagger UI, it doesn't work properly either. It should be the UI's issue, not ours.
from azure-functions-openapi-extension.
@justinyoo Thanks for the reply. I don't think the URL encoding of parameters is a Swagger UI issue, so I don't think it needs to be addressed, but I think the "catch all" parameter not being included in the OpenAPI definition is another issue.
from azure-functions-openapi-extension.
@shibayan Yeah, it's not something I can do on my end. If you Google it, there are so many discussions around - from the spec wise to the implementation perspective.
I'm not too sure, we can get it through the proxies.json
file. Let me try.
from azure-functions-openapi-extension.
Related Issues (20)
- Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore support HOT 1
- .NET 8, Function Decorators Not Recognized HOT 27
- Loading types from referenced dll's should be optional, very poor performance of generating swagger document for large projects.
- .NET 8 isolated process - "The type or namespace name 'Azure' does not exist..." HOT 1
- Cannot Generate Open API swagger.json file if inheriting from ITableEntity From Azure.Data.Tables HOT 1
- Support for X-Forwarded-Host HOT 2
- Ordering tags alphanumerically
- IOpenApiHttpTriggerAuthorization requires IHttpRequestDataObject but function has HttpRequestData
- Support Specification Extensions HOT 1
- Setting the base url in isolated worker azure function HOT 2
- Add more options to control exposed Swagger endpoints HOT 1
- .NET framework Isolated - The system cannot find the file specified.
- 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 3
- 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
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.