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

Add support for alternate keys on navigation properties #410

Closed
andrueastman opened this issue Jul 27, 2023 · 3 comments · Fixed by #454
Closed

Add support for alternate keys on navigation properties #410

andrueastman opened this issue Jul 27, 2023 · 3 comments · Fixed by #454
Assignees
Labels
priority:p1 High priority but not blocking. Causes major but not critical loss of functionality SLA <=7days type:enhancement Enhancement request targeting an existing experience.
Milestone

Comments

@andrueastman
Copy link
Member

The learningContent has the alternate Key present in the metadata set as externalId,

However, the alternate key path is not generated in the collection path in the openApi document with the AlternateKey setting.

      <EntityType Name="learningContent" BaseType="graph.entity">
...
        <Annotation Term="Org.OData.Core.V1.AlternateKeys">
          <Collection>
            <Record Type="Org.OData.Core.V1.AlternateKey">
              <PropertyValue Property="Key">
                <Collection>
                  <Record Type="Org.OData.Core.V1.PropertyRef">
                    <PropertyValue Property="Alias" String="externalId" />
                    <PropertyValue Property="Name" PropertyPath="externalId" />
                  </Record>
                </Collection>
              </PropertyValue>
            </Record>
          </Collection>
        </Annotation>
      </EntityType>

From tentative investigations, it looks like the setting may only work on Entity sets and not other nav properties that return collections.

@baywet
Copy link
Member

baywet commented Jul 31, 2023

We received the same question on the internal stack overflow.

After digging further

Key Entity Present In OpenAPI Has Entity Set
appId application Y Y
appId servicePrincipal Y Y
deviceId device Y Y
roleTemplateId directoryObjectPartnerReference Y Y
externalcourseActivityId learningCourseActivity N N
externalId learningContent N N

Both the entity types this workload defines with alternate keys are only exposed through navigation properties and do not have entity sets contrary to the ones exposed by the AAD workload. Which sounds a lot like a limitation of this conversion library.

Updated the title and the issue properties to reflect the work to be done: support alt keys on navigation properties.
The only challenge here is the odata spec is not explicit about navigation property support nor is the vocab definition

@baywet baywet changed the title Alternate Key path for /learningContents(externalId='{externalId}') is not generated Add support for alternate keys on navigation properties Jul 31, 2023
@baywet baywet added type:enhancement Enhancement request targeting an existing experience. priority:p1 High priority but not blocking. Causes major but not critical loss of functionality SLA <=7days labels Jul 31, 2023
@baywet
Copy link
Member

baywet commented Jul 31, 2023

I got a confirmation this scenario is supported at the AGS level. from @syprieur
And I received confirmation this is intended to be supported even though the specification is not super clear on that from @mikepizzo
We're good to proceed.
https://issues.oasis-open.org/browse/ODATA-1590?jql=project%20%3D%20ODATA

@andrueastman
Copy link
Member Author

Thanks @baywet

Adding this path as part of the success criteria for the issue is also missing due to the same issue.

GET https://graph.microsoft.com/v1.0/employeeExperience/learningProviders/01e8f81b-3060-4dec-acf0-0389665a0a38/learningCourseActivities(externalCourseActivityId=12a2228a-e020-11ec-9d64-0242ac120002)
https://learn.microsoft.com/en-us/graph/api/learningcourseactivity-get?view=graph-rest-1.0&tabs=http#example-2-get-a-learning-course-activity-based-on-the-externalcourseactivityid-of-the-learning-provider

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:p1 High priority but not blocking. Causes major but not critical loss of functionality SLA <=7days type:enhancement Enhancement request targeting an existing experience.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants