You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My API has some derived types that I am trying to expand. It seems that odata-query is not able to describe the cast to the derived type in object form and manually entering the cast as a string value is interpreted as a nested expand. I understand the benefit of the string valued shorthand, but it precludes the ability to cast to the derived type.
Here is a contrived scenario: Namespace: Example Entities:
If I want to query all of the Shapes but expand the Vertices for any Square objects, the query would be:
[root]/Shapes?$expand=Example.Square/Vertices
The object form doesn't have the ability to specify type, which isn't too big a deal since it is a more complex scenario. However, passing the string of "Example.Square/Vertices" to the expand property results in the this query:
Obviously, the above isn't correct given the model.
I realize that removing or modifying the string shorthand would be a large breaking change for many. Given that, is there a workaround for this scenario? Would it be possible to add this ability within the object form? Other ideas?
Quick Edit: OData v4
The text was updated successfully, but these errors were encountered:
👍 To that, it looks like it's impossible to expand properly using namespace cause '/' is translated to property expansion. Any chance this will get some love?
Hello,
I am using this library via https://github.com/diegomvh/angular-odata and have run into something that isn't currently supported. (I think)
My API has some derived types that I am trying to expand. It seems that odata-query is not able to describe the cast to the derived type in object form and manually entering the cast as a string value is interpreted as a nested expand. I understand the benefit of the string valued shorthand, but it precludes the ability to cast to the derived type.
Here is a contrived scenario:
Namespace: Example
Entities:
Endpoints:
If I want to query all of the Shapes but expand the Vertices for any Square objects, the query would be:
The object form doesn't have the ability to specify type, which isn't too big a deal since it is a more complex scenario. However, passing the string of "Example.Square/Vertices" to the expand property results in the this query:
Obviously, the above isn't correct given the model.
I realize that removing or modifying the string shorthand would be a large breaking change for many. Given that, is there a workaround for this scenario? Would it be possible to add this ability within the object form? Other ideas?
Quick Edit: OData v4
The text was updated successfully, but these errors were encountered: