Comments (3)
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.
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.
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)
- ASP.NET Web API versioning Migrate from QueryStringApiVersionReader to UrlSegmentApiVersionReader HOT 2
- only the 5.1.0 version of Microsoft.AspNetCore.Mvc.Versioning is deprecated HOT 3
- Problem with describing reponse codes in minimal api HOT 3
- Cannot run APIs with different controller names with same ControllerName attribute after migration HOT 6
- Different options in `ApiVersioningOptions.cs` between .NET Framework and .NET Core packages HOT 2
- WithOpenApi() ignore Api versioning readers HOT 4
- .net 8 support HOT 7
- Breaking changes when migrating to OData8 + new versioning HOT 10
- AddVersionedApiExplorer not working in Asp.Versioning HOT 5
- VersionedApiDescriptionProvider does not set the correct SunsetPolicy to ApiDescription instances HOT 1
- Using ApiExplorerSettingsAttribute together with ApiVersionAttribute produces unexpected number of ApiVersionDescriptions HOT 5
- Asp.Net Core WebApi - AWS ECS Cluster Authentication failure HOT 2
- [Versioned Clients][API Notifications] Fails to read new versions when available HOT 2
- Swashbuckle documentation inconsistent with examples HOT 2
- AssumeDefaultVersionWhenUnspecified does not work correctly if ApiVersionNeutral is used in the controller HOT 2
- swagger.json file not found after update HOT 9
- My API is not displaying all the versions. HOT 4
- Improve docs for HeaderApiVersionReader
- Add synonym to `AddMvc` method. HOT 7
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 aspnet-api-versioning.