Skip to content

fix #797 - Remove type-cast from SelfLinks. - #798

Closed
uffelauesen wants to merge 2 commits into
OData:mainfrom
uffelauesen:remove-type_cast-from-odata.id
Closed

fix #797 - Remove type-cast from SelfLinks.#798
uffelauesen wants to merge 2 commits into
OData:mainfrom
uffelauesen:remove-type_cast-from-odata.id

Conversation

@uffelauesen

@uffelauesen uffelauesen commented Jan 6, 2023

Copy link
Copy Markdown
Contributor

Fixes issue #797
Type cast segment are no longer added to self links.
Test DerivedTypeNavPropertyLink_FullMetadata shows the expected behavior.
According to http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part2-url-conventions/odata-v4.0-errata03-os-part2-url-conventions-complete.html#_Toc453752341 the cast segment (derived type name) is not to be part of the Canonical URL. odata.id is normally identical to the Canonical URL, but AspNetCoreOData adds the type cast segment to the selfLink and this seems wrong according to spec.
Another place in the spec has a different conflicting example - http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part2-url-conventions/odata-v4.0-errata03-os-part2-url-conventions-complete.html#_Toc453752341 in this part it is described that the resource URL includes the cast segment.
To me it seems wrong that the cast segment should be included in the odata.id - meaning I agree with the first link.

@KenitoInc

Copy link
Copy Markdown
Contributor

Add a description on what this PR is fixing.
Also add tests.

@uffelauesen

Copy link
Copy Markdown
Contributor Author

Hi @KenitoInc

Add a description on what this PR is fixing. Also add tests.

Description added and test pushed to PR branch.

@gathogojr

Copy link
Copy Markdown
Contributor

Resolved by #831

@gathogojr gathogojr closed this Feb 1, 2023
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.

3 participants