Giter VIP home page Giter VIP logo

Comments (7)

rbeauchamp avatar rbeauchamp commented on August 30, 2024

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.

rbeauchamp avatar rbeauchamp commented on August 30, 2024

This is basically a bug: the response model should be accurate. I'll handle it.

from swashbuckle.odata.

rbeauchamp avatar rbeauchamp commented on August 30, 2024

@joshbooker Out of curiosity, what tools are you using against the swagger json?

from swashbuckle.odata.

joshbooker avatar joshbooker commented on August 30, 2024

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.

joshbooker avatar joshbooker commented on August 30, 2024

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.

 avatar commented on August 30, 2024

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.

joshbooker avatar joshbooker commented on August 30, 2024

Thanks. Works Great! Error response issue here: #51

from swashbuckle.odata.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.