Skip to content
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

[Feature] Add support for ExplicitOperationBindings #2543

Closed
irvinesunday opened this issue Oct 31, 2022 · 7 comments
Closed

[Feature] Add support for ExplicitOperationBindings #2543

irvinesunday opened this issue Oct 31, 2022 · 7 comments

Comments

@irvinesunday
Copy link

By default, we do not bind operations to non-containment navigation properties. We, however, have certain scenarios where we might need this binding. There were deliberations around this and the following was proposed by @mikepizzo

MicrosoftTeams-image (5)

However, in order to use the annotation ExplicitOperationBindings, we need the ModelElementPath expression defined in the edm library to be able to represent an EDM model element path.

Assemblies affected

Microsoft.OData.Edm 7.10.0

Reproduce steps

None. This is a new feature request.

Expected result

To be able to retrieve the value expressed by the ModelElementPath expression.
Open questions:

  1. Are we able to retrieve the target EDM element?
  2. If the target EDM element is a navigation property, can we also retrieve its declaring entity type?

Actual result

None. This is a new feature request.

Additional detail

Related to: microsoft/OpenAPI.NET.OData#232

@mikepizzo
Copy link
Member

While adding support for IEdmModelElementPath is a good improvement, note that the initial proposal for this particular application (constraining actions/functions to particular paths) has evolved. The final proposal does not require model element path:

<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>

@irvinesunday
Copy link
Author

irvinesunday commented Nov 3, 2022

The proposal will have to officially be approved and the new Terms: RequiresExplicitBinding, ExplicitOperationBindings added to the OData.Edm lib before they can be used, correct?

@mikepizzo
Copy link
Member

mikepizzo commented Feb 6, 2023

The OASIS proposal has been approved. We are working on implementing.

@mikepizzo mikepizzo changed the title [Feature] Add support for IEdmModelElementPath expression [Feature] Add support for ExplicitOperationBindings Feb 7, 2023
@mikepizzo
Copy link
Member

mikepizzo commented Feb 7, 2023

Updated title since the approved vocabulary terms don't require IEdmModelElementPath.

@mikepizzo mikepizzo added P2 and removed P3 labels Feb 7, 2023
@mikepizzo
Copy link
Member

Link to related OASIS PR: oasis-tcs/odata-vocabularies#214.

@habbes
Copy link
Contributor

habbes commented Mar 9, 2023

@irvinesunday @mikepizzo @lisicase seems like the ExplicitOperationBindings and RequiresExplicitBinding terms have already been added to the Edm library by this PR: #2614
Seeing that IEdmModelElementPath is no longer required for this feature, is there any additional work pending for this task or is it good to go?

@irvinesunday
Copy link
Author

@habbes @mikepizzo @lisicase thanks a bunch for this fix. We have already implemented this and gotten unblocked ❤

@habbes habbes closed this as completed May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants