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

Do not allow content type property aliases that conflict with IPublishedElement #14683

Merged
merged 1 commit into from
Aug 21, 2023

Conversation

kjac
Copy link
Contributor

@kjac kjac commented Aug 16, 2023

Prerequisites

  • I have added steps to test this contribution in the description below

Description

It is currently possible to define content type properties with aliases that conflict with IPublishedElement properties - e.g. ContentType and Properties. This becomes a problem when ModelsBuilder creates strongly typed models:

image

We're already trying to avoid this scenario in the server side validation. However, we're only testing for properties and methods defined on IPublishedContent.

With this PR we also test properties from base interfaces like IPublishedElement. Now we can no longer create properties with clashing aliases:

image

Note that the TypeExtensions changes in this PR have been copied over from similar changes in a V14 PR, thus adding more new extension methods than strictly necessary for this PR. This hopefully will make forward merging easier 😄

@Zeegaan
Copy link
Member

Zeegaan commented Aug 21, 2023

Looks good, tests good 🚀

@Zeegaan Zeegaan merged commit 0dc1898 into v10/dev Aug 21, 2023
16 checks passed
@Zeegaan Zeegaan deleted the v10/fix/reserved-properties-on-ipublishedelement branch August 21, 2023 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants