Add support for alternate keys #120
Labels
priority:p2
Medium. Generally has a work-around and a smaller sub-set of customers is affected. SLA <=30 days
type:enhancement
Enhancement request targeting an existing experience.
Milestone
Models containing alternate keys cannot easily be converted to OpenAPI. Corresponding paths provided by a custom path provider lead to an unhandled exception in parameter creation.
Assemblies affected
All versions of Microsoft.OpenApi.OData.Reader.dll
Steps to reproduce
See the following modifications of the single key test. It reflects a case for an alternate key path http://host/service/Customer(AlternateId='A1245') which was added by a custom
ODataPathProvider
handed over in theOpenAPIConvertSettings
. The same can be achieved for multi-part alternate keys.Expected result
No exception without considering alternate keys.
Actual result
KeyNotFoundException in OpenApiParameterGenerator.CreateKeyParameters
Additional detail
Given the mere example
http://host/service/Employees(ID='A1245')
from OData Version 4.01. Part 2: URL Conventions, without a model it is unclear whether one should rely on the (primary) key or an alternate key. Since the model is known for the generator, not only the primary key but also the alternative keys could be taken into account when mapping the parameter names. Definitely it should work fault tolerant with any other PathProvider then the default ODataPathProvider.The text was updated successfully, but these errors were encountered: