Skip to content

Fixed overwriting of the ODataUriResolver, received upstream from DI (e.g. AlternateKeysODataUriResolver) - #389

Merged
KenitoInc merged 5 commits into
OData:masterfrom
jfshark:master
Dec 3, 2021
Merged

Fixed overwriting of the ODataUriResolver, received upstream from DI (e.g. AlternateKeysODataUriResolver)#389
KenitoInc merged 5 commits into
OData:masterfrom
jfshark:master

Conversation

@jfshark

@jfshark jfshark commented Nov 23, 2021

Copy link
Copy Markdown
Contributor

In the current implementation the line 42 in DefaultODataPathParser.cs ignores already assigned value in Resolver property and just rewrites it. It looks like a bug and addition of custom ODataUrtiResolver (see example below) in DI does not work anymore . Especially taking into consideration the fact that this DefaultODataPathParser is explicitly created in ODataResourceDeserializer (not from DI) (see image)

.AddOData(opt => opt.AddRouteComponents("odata/v1", edmModel,
				services => services.AddSingleton<ODataUriResolver>(sp => new AlternateKeysODataUriResolver(edmModel))
			));

image

jfshark and others added 5 commits October 26, 2021 14:55
If the function parameter, marked with [FromODataUri] has custom type in the model (TypeDefinition) it could still be processed as a primitive (cause it has primitive underlying type)
@corranrogue9

Copy link
Copy Markdown
Contributor

I'd really love to see a test for this

@KenitoInc
KenitoInc merged commit b2ae6c2 into OData:master Dec 3, 2021
@KenitoInc

Copy link
Copy Markdown
Contributor

@jfshark Thanks for the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants