odata.net icon indicating copy to clipboard operation
odata.net copied to clipboard

Update ODL to use configurable alternate key vocabulary

Open corranrogue9 opened this issue 3 years ago • 3 comments

The AlternateKeysODataUriResolver relies on the GetAlternateKeysAnnotation extension method, which uses a hard-coded value here to find the alternate keys that can be resolved. The hard-coded value refers to the community vocabulary, and cannot be configured by the AlternateKeysODataUriResolver. This should be configurable so that customers can specify the core vocabulary (or any other vocabulary) if they want.

Please create an issue for AGS to support the core vocabulary when this is fixed, and please create an issue to get the guidance updated once AGS support the core vocabulary.

corranrogue9 avatar Jul 22 '22 17:07 corranrogue9

I'd love to see the fix in ODL because that's also a "blocker" at https://github.com/OData/AspNetCoreOData/blob/main/test/Microsoft.AspNetCore.OData.E2E.Tests/AlternateKeys/AlternateKeysEdmModel.cs#L141-L142

xuzhg avatar Jul 25 '22 20:07 xuzhg

Still need AGS follow-ups, I'll close it as soon as those items are created.

corranrogue9 avatar Aug 18 '22 00:08 corranrogue9

The implementation in #2470 breaks the spec requirements defined in the Community vocabularies: https://github.com/OData/vocabularies/blob/master/OData.Community.Keys.V1.md#216key-declaration-uniqueness

Services SHOULD NOT return multiple alternate key definitions for the same entity type that are composed of the exact same set of properties.

The Alternate keys may be serialized under 2 distinct namespaces (Community or Core), but ultimately they point to the same concept in the Edm type, and unicity rules SHOULD be upheld.

syprieur avatar Sep 01 '22 22:09 syprieur