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
{{ message }}
Repository navigation
Bound operations not appended to non-contained navigation property paths #232
and given a schema namespace value of microsoft.graph
We expect to generate paths similar to below: .../followedSites/microsoft.graph.add
This is not the case with the current version because we check the containment of the navigation property here.
According to the spec. doc., see ref:
Actions and Functions MAY be bound to an entity type, primitive type, complex type, or a collection...
The namespace- or alias-qualified name of a bound operation may be appended to any URL that identifies
a resource whose type matches, or is derived from, the type of the binding parameter.
This may be applied to any navigation property segment as long as its type matches the type of the binding parameter.
changed the title [-]Bound operations not created on non-contained navigation properties[/-][+]Bound operations not appended to non-contained navigation property paths[/+]on Jun 10, 2022
Thanks for documenting this in details. I'm torn here.
Historically we've decided to only bind operations to contained navigation properties, entity sets or singletons. Or in other words to only have operations on the entities canonical path. This is to avoid expanding too many paths and growing the description too much. It makes sense since why would one call an operation on a "deeper path" when a shallower one is already available?
This case is an interesting example, and poor API design IMHO. The followed sites should instead be a collection of "followedSite", contained. FollowedSite is a new entity type that semantically belongs to the user (is contained), has a non-contained reference to site (existing entity), and potentially other properties like "followedDate", "followedReason", etc...
But since the API is not getting fixed any time soon, we probably out to make an opiniated decision here.
What would be the consequence of setting contains target true for that property?
Can we rely on an annotation/attribute that would signal "bind operations even though this is not contained"?
Do we have other cases like this one?
after a quick chat with Darrel (@darrelmiller) it looks like there's no such annotation. Can you have a look at the implications of changing contains target for that property? and see if we have other instances of that scenario?
after a quick chat with Darrel (@darrelmiller) it looks like there's no such annotation. Can you have a look at the implications of changing contains target for that property? and see if we have other instances of that scenario?
Appending ContainsTarget=true generates 1042 more paths. I'm collating the list of other navigation props. that have a similar issue.
To provide an update to everyone here: Darrel brought it to the API council and it was decided to introduce a new attribute/annotation to say something like "target properties" which would contain list of non contained properties we want that method to target additionally to the contained properties/entity sets/singleton.
Next step is to get Michael Pizzo (@mikepizzo) to provide us guidance for that new attribute/annotation, but if you have suggestions, feel free to add them here.
From discussions with Darrel (@darrelmiller), the recommendation was to come up with a custom annotation that will be appended to a given operation. This annotation will list the non-contained navigation properties that should append paths to the given operation. The annotation would look something like:
After further discussions, the below annotation structure has been arrived at:
<Term Name="RequiresExplicitBinding" Type="Core.Tag" DefaultValue="true" AppliesTo="Action, Function">
<Annotation Name="Description" Edm.String="This bound action or function is only available on model elements annotated with the ExplicitOperationBinding term."/>
</Term>
<Term Name="ExplicitOperationBindings" Type="Collection(Edm.String)">
<Annotation Name="Description" Edm.String="The qualified names of explicitly bound operations that are supported on the target model element. These bindings are in addition to any bindings to the type of the target model element not annotated with RequiresExplicitBinding"/>
</Term>
Activity
[-]Bound operations not created on non-contained navigation properties[/-][+]Bound operations not appended to non-contained navigation property paths[/+]baywet commentedon Jun 20, 2022
Thanks for documenting this in details. I'm torn here.
Historically we've decided to only bind operations to contained navigation properties, entity sets or singletons. Or in other words to only have operations on the entities canonical path. This is to avoid expanding too many paths and growing the description too much. It makes sense since why would one call an operation on a "deeper path" when a shallower one is already available?
This case is an interesting example, and poor API design IMHO. The followed sites should instead be a collection of "followedSite", contained. FollowedSite is a new entity type that semantically belongs to the user (is contained), has a non-contained reference to site (existing entity), and potentially other properties like "followedDate", "followedReason", etc...
But since the API is not getting fixed any time soon, we probably out to make an opiniated decision here.
What would be the consequence of setting contains target true for that property?
Can we rely on an annotation/attribute that would signal "bind operations even though this is not contained"?
Do we have other cases like this one?
baywet commentedon Jun 20, 2022
after a quick chat with Darrel (@darrelmiller) it looks like there's no such annotation. Can you have a look at the implications of changing contains target for that property? and see if we have other instances of that scenario?
irvinesunday commentedon Jun 21, 2022
Appending
ContainsTarget=truegenerates 1042 more paths. I'm collating the list of other navigation props. that have a similar issue.irvinesunday commentedon Jul 13, 2022
The number of similar scenarios are quite significant. Below are just a couple of them:
** Non-containment Navigation properties:**
Entities:
Clearly, setting their containment to
truewill be unfeasible, as the number of paths generated will just be humongous.baywet commentedon Jul 14, 2022
To provide an update to everyone here: Darrel brought it to the API council and it was decided to introduce a new attribute/annotation to say something like "target properties" which would contain list of non contained properties we want that method to target additionally to the contained properties/entity sets/singleton.
Next step is to get Michael Pizzo (@mikepizzo) to provide us guidance for that new attribute/annotation, but if you have suggestions, feel free to add them here.
irvinesunday commentedon Aug 29, 2022
From discussions with Darrel (@darrelmiller), the recommendation was to come up with a custom annotation that will be appended to a given operation. This annotation will list the non-contained navigation properties that should append paths to the given operation. The annotation would look something like:
2 remaining items
irvinesunday commentedon Nov 2, 2022
After further discussions, the below annotation structure has been arrived at:
Example usage:
Find further reading of the proposal here
irvinesunday commentedon Feb 28, 2023
This issue is blocked while waiting for the resolution of: OData/odata.net#2543
darrelmiller commentedon Mar 25, 2023
Can we confirm that we are no longer blocked?
irvinesunday commentedon Apr 28, 2023
This is now unblocked. The PR to resolve this: #378
irvinesunday commentedon May 2, 2023
Resolved by: #378