Comments (7)
I was thinking about this too the other day, that the response model is not accurate. Its been good enough for human use but is probably not good for tooling use.
from swashbuckle.odata.
This is basically a bug: the response model should be accurate. I'll handle it.
from swashbuckle.odata.
@joshbooker Out of curiosity, what tools are you using against the swagger json?
from swashbuckle.odata.
Mostly Azure App Service Logic Apps. An OData project can be published as an API App then used as a custom connector in Logic Apps. The Logic Apps tooling reads swagger response schema and builds expressions against the json response. The current schema works great as the tooling displays a list of Order properties. The problem is, the tooling doesn't know the Orders array is wrapped in a value array. When manually edit expressions in code view of logic app designer I can successfully include .value - just the tooling doesn't do it for me. It tried to change the response schema in an Operation Filter as a test, but couldn't figure it out.
Additionally I've used swaggerhub.com and editor.swagger.io. They don't really act on response schema, so they're not really affected by this particular problem. They do show the response model so they were helpful in determining the suggested sample response schema in my post above.
Off topic: These tools have other issues. I cannot send a request because they include unused parameters in the URI. (/Orders?$expand=&$filter=&etc) OData doesn't like that. I tried including the swagger allowEmptyValue = false (which should be the default) but that had not affect. I'm of the opinion that they should leave off unused params like the swagger UI does. If anybody has any ideas here I'd like to know.
Anyway thanks for your hard work.
from swashbuckle.odata.
Oh yeah, also I noticed I'm not getting default error response schemas. I think the original OData swagger utilities was including these, but they got lost somewhere here. Pretty sure most tools will be happier having a default response to catch error message.
from swashbuckle.odata.
The response model is now correct for collections in v2.10.1. Please give it a try. An error response model will be an enhancement; please create a separate ticket for this. Thanks!
from swashbuckle.odata.
Thanks. Works Great! Error response issue here: #51
from swashbuckle.odata.
Related Issues (20)
- SchemaRegistryExtensions.GetPropertyNameForEdmModel returns wrong Edm Property name HOT 2
- Calling for Maintainers HOT 6
- Swagger generation resulting in error. Error thrown from SwaggerRouteStrategy.cs line 62
- AdjustRelativePathForStringParams is not working case-insensitive (param names)
- Method not found: 'Flurl.Url Flurl.Url.AppendPathSegment(System.Object)' HOT 1
- Precondition Failure
- Swagger docs don't have type information for Get method when it returns IHttpActionResult HOT 2
- Add custom property resolver to 4.0.0
- Unbound actions generate invalid swagger HOT 2
- Entity bound actions can have ODataActionParameters type parameters only
- Custom type parameters for OData functions HOT 1
- Exploring different version at the same time throw an error.
- Support for Microsoft.AspNet.OData 7? HOT 10
- Swashbuckle.OData.Core throws Specified argument was out of the range of valid values exception and failing to generate swagger ui HOT 1
- Need Help OData V4 REST Web API Documentation HOT 4
- Swashbuckle.OData.Core is too slow, consume 60% memory while open swagger in chrome browser HOT 4
- OData Web API Controller Summary not showing in swagger
- Swashbuckle.OData compatibility with OData V3 Controllers HOT 1
- Swagger generation fails for Entities having DataContractAttribute fails with "Sequence contains no matching element" when used in OData Actions. HOT 1
- Accurate OData response schema
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.odata.