-
Notifications
You must be signed in to change notification settings - Fork 711
API Explorer Settings Not Honored with Implicit API Version #519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@ckuykendall81 I've updated the title and details, which should immediately unblock you. The simplest path for you would be to use an explicit API version. This can easily be done with an attribute, but if you have a lot of controllers, you can address that using a convention instead. You should also know that you'll probably be snagged by OData/WebApi#1750 as well. I've updated your example to address this external problem as well as a few other minor tweaks. I was able to get things working with these changes in place. Let me know if you have any questions. |
Couldn't get api version to work for me, but the adding the other attribute to the actions did work and satisfied my need. Thank you. |
Hi @commonsensesoftware , I am facing the same error here and I tried your WebApplication2.zip . I still face the problem,
and when I try to create my own edm-model like I get the error: I am really confused on where I am going wrong here. Any leads here? -Thanks |
@manisha201301 I don't think I have enough context to give you an answer. Are you using attributes or pure conventions? It looks like the routes, explicit or implicit, are not matching up |
Hi, I am using the Startup.cs from the sample, the only change is the customized EdmModel, which I created like this:
My Controller is exactly similar to TestController of the Sample and My Class-Model1/Class-Model-2 are POCOs like this: |
@manisha201301 if you're using I'd also point out that you can use pure POCOs with OData. If you follow it's conventions, you need no attribution at all. If you don't follow the convention in your models, you can still apply conventions in the builder so that no attributes are required (but that's obviously a choice between A or B). |
Thank you for replying,
I get the following error:
even after changing Tests to have key:
Any idea, what must have gone wrong? |
Nevermind, I solved it. Thanks :) |
Uh oh!
There was an error while loading. Please reload this page.
Symptoms
When OData is mixed and matched with non-OData controllers and actions, then
[ApiExplorerSettings]
are not honored.Triage
After investigation, the issue doesn't seem to be specific to OData, but rather any controller or action that uses implicit versioning (e.g. no explicit attributes or conventions). This should be allowed, but is missed do to the underlying ControllerModel not being attached to implicitly versioned ActionModel instances.
Workaround
There are two simple workarounds to this problem until the next patch.
[ApiVersion("1.0")]
)[ApiExplorerSettings(IgnoreApi=false)]
directly on actions rather than the controllerThe text was updated successfully, but these errors were encountered: