Giter Site home page Giter Site logo

Comments (3)

commonsensesoftware avatar commonsensesoftware commented on June 4, 2024

This is a rare edge case, but it is the expected behavior.

The $metadata endpoint, like the API Explorer, collates API versions from all OData controllers. If all of the APIs are version-neutral, then there is nothing to collate. This is a very strange use case. There's no reason for all APIs to be version-neutral. What's the point of using API Versioning if everything is neutral? Version-neutral doesn't mean unversioned. A version-neutral API should not, and will not, respond to an API version that doesn't exist. An API, version-neutral or not, shouldn't respond to ?api-version=42.0 if it doesn't exist.

If you configure ApiVersioningOptions.AssumeDefaultVersionWhenUnspecified = true, then things might work. I seem to recall that if no versions are found, ApiVersioningOptions.DefaultApiVersion is used as a fallback. I'm not sure if that changes anything for you. It's not something I believe I've tried or tested for. It's very strange use case.

Unless you only had one API, it's your first API, and it just happens to be version-neutral, I'm not sure why you'd want to do this. Can you explain your use case a bit more? I suspect there is a better way to do what you are trying to achieve.

from aspnet-api-versioning.

commonsensesoftware avatar commonsensesoftware commented on June 4, 2024

There wasn't any additional follow-up or push-back. This behavior is expected and is an unfortunate limitation and edge case that is effectively nonsensical in a real application. I could document this as a known limitation if you feel it is warranted. It's such a bizarre use case, I never thought anyone would actually hit it.

from aspnet-api-versioning.

commonsensesoftware avatar commonsensesoftware commented on June 4, 2024

This behavior is expected albeit not as obvious as one might expect. The discussion appears to have gone idle and I don't think there's any more to do. If there, feel free to reopen the issue.

from aspnet-api-versioning.

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.