-
Notifications
You must be signed in to change notification settings - Fork 712
Issue with OData Singleton entity controller actions #610
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
The first issue does not appear to be related to ODataQueryOptions. The issue is that there is no type information available. If you're not going to use Reverse generation of route templates is difficult. There are no APIs that handle that. There are a number of complex OData routes. I'm not sure I have an example of a singleton. It's quite possible that scenario is broken. If the correct template is not being generated by convention, then the simplest workaround is to use attribute routing. Do you have a repro you can share? Singleton route template generation should be supported. If it's not working correctly, I take it as a bug once verified. |
Oh, no I've tried with ProducesResponseType attribute (with
Sorry but no, I have no any prepared repository. I will need some time to prepare it. |
Hmmm ... interesting. While you're putting something together, I will attempt to investigate in parallel. Thanks. |
Quickly configured version of repository: https://github.com/Graph2133/ODataSingletonIssue |
Any news on this issue? Maybe an example of Singleton usage with Versioning? |
I'll categorize this as a bug since it's not what you expect (POLA); however, it's more of an enhancement. It seems I just missed the case for Singletons. I've personally never used them, but they should be supported if you want to use them. The following top-level operations should be supported:
There's currently no consideration for singleton generation at all. There's several other issues related to API exploration and route template generation. This fix will roll up into those. I'll use the repro for the Litmus test. Thanks. |
Singletons are properly supported in 5.0.0-RC.1. The official release will likely occur after 2 weeks of burn-in. The test suite and samples now include usage of singletons. If the issue returns, please reopen the issue or file a new one. Thanks. |
Hello, could you please help me. I'm trying to configure endpoint in OData controller which is configured as Singleton in my edm model. I'm reusing this sample https://github.com/microsoft/aspnet-api-versioning/tree/master/samples/aspnetcore/SwaggerODataSample (release 4.0 because it's crucial for real project which I'm working on).
My controller has nothing extraordinary but just one simple action
But swashbuckle can not load api definitions and I'm getting this error:
If I remove ODataQueryOptions all works but I need them for proper generation of expansion properties because I want load only needed data to my singleton result using query options (checking whether needed expansion property was requested).
This works with route "
api/pizza
" and swashbuckle generate proper schema:And I've also question regarding generation of routes. Let's say iIve the same configuration I mentioned above but my controller will look like this (I will omit setting of ODataRoute and will use default routing convention)
Is it expected behavior that swagger action looks like this:
Shouldn't it be also
api/pizza
?The text was updated successfully, but these errors were encountered: