Comments (11)
On further examination, this actually works if the [FromRoute] decorator within the request record has a Name attribute specified, like so:
[FromRoute(Name = "id")]
I was under the impression that this would be inferred somehow - or is this indeed the intended behavior?
from swashbuckle.aspnetcore.
@RasmusEdvardsen. The issue that you are describing here should be fixed just by adding [FromRoute] on the object property.
But if you do that, you have to specify the Route in the controller as Id instead of id( It's case sensitive).
Do you want it to be case insensitive?
from swashbuckle.aspnetcore.
@jgarciadelanoceda Ah I see, that might be what I'm referring to in my latest comment. If you ask me my personal preference, I'd just want it to work the same way it does as if it was specified directly on the controller parameter. If it already does, I apologize for taking time out of your schedule. Thanks for a good project, btw.
from swashbuckle.aspnetcore.
I'll look at this feature, because it seems to be a issue of the library although with dotnet 8 you will have the issue
dotnet/aspnetcore#54212. It's a nice to have case insensitive on the Route parameters
from swashbuckle.aspnetcore.
Agreed - and yea, it does seem like the issue you linked pertains to this issue. I went around it the dirty way - suppressing the warning.
from swashbuckle.aspnetcore.
As far as I have seen it's an issue with the JS that is part of the /swagger-api/swagger-ui package, I was not able to get a way to make the filtering by Path case insensitive with this library :(
from swashbuckle.aspnetcore.
@RasmusEdvardsen. The issue that you are describing here should be fixed just by adding [FromRoute] on the object property.
But if you do that, you have to specify the Route as Id instead of id( It's case sensitive).
I think that when this issue is solved, we could handle swagger-api/swagger-ui#8143
from swashbuckle.aspnetcore.
Alright, sounds good, thanks. I'll close this, and let's hope the linked issue will be fixed soon 👍
from swashbuckle.aspnetcore.
@jgarciadelanoceda do you want me to close this for now? I realised I should've asked you first, as you have linked this one in swagger-api/swagger-ui#8143
from swashbuckle.aspnetcore.
As you please, I showed that it has linked a PR that has been active for 3 years, but I hope they merge it
from swashbuckle.aspnetcore.
Okay, I'll close it. Thanks
from swashbuckle.aspnetcore.
Related Issues (20)
- [Bug]: "InvalidOperationException: Sequence contains more than one matching element" in Swagger when using multiple [FromForm] parameters in Minimal API HOT 2
- [Feature request]: SwaggerIgnoreAttribute for FromForm requests HOT 6
- [Bug]: The JSON value could not be converted to System.DateOnly HOT 12
- [Bug]: Passing example in param XML documentation not working with record types HOT 3
- [Bug]: Swagger Page response Json result error HOT 1
- [Bug]: JSON on string input gets set to null. HOT 1
- [Bug]: 6.6.2 doesn't accept Assembly in the param in IncludeXmlComments HOT 1
- [Bug]: Reference types not nullable with required modifier HOT 1
- [Bug]: DefaultValue(null) doesn't work with nullable int HOT 2
- [Bug]: Authentication problem with 6.6.2 HOT 7
- [Bug]: ProblemDetails can't be generated as Swagger Schema HOT 1
- [Bug]: Swagger produces different swagger file on Linux HOT 3
- [Question]: Polymorphism DiscriminatorValueSelector work with JsonDerivedTypeAttribute HOT 1
- [Bug]: Command dotnet tool install Swashbuckle.AspNetCore.Cli returns 401 for .NET 8 HOT 1
- [Bug]: Breaking change in 6.6.1; It now requires you to have the `Regex` Route Constraint even if you don't use it HOT 1
- [Bug]: Breaking change with Dictionary of Enum, when Enum has multiple values with same ordinal HOT 1
- [Feature request]: Support new .NET 8 Model State attributes HOT 4
- [Bug]: Breaking: Writes default values for exclusiveMaximum/exclusiveMinimum to openapi.json HOT 2
- [Question]: How to enumerate values a string can take on? HOT 2
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 swashbuckle.aspnetcore.