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

KPropertyPath doesn't support Iterables #3010

Open
ghost opened this issue Dec 21, 2023 · 1 comment
Open

KPropertyPath doesn't support Iterables #3010

ghost opened this issue Dec 21, 2023 · 1 comment
Labels
in: kotlin Kotlin support status: ideal-for-contribution An issue that a contributor can help us with type: enhancement A general enhancement

Comments

@ghost
Copy link

ghost commented Dec 21, 2023

The KPropertyPath currently doesn't support references from Iterables such as List, Set, etc. to the type of the element.

data class User(
    val name: String,
    val addresses: List<Address>
) {
    data class Address(
        val street: String
    )
}

val path = User::addresses / User.Address::street // a type mismatch between the expected the `Address` and offered `List<Address>` occurs here

The implementation in org.springframework.data.mapping.KPropertyPath should be able to construct paths such as addresses.street for the usage in indexes, queries and aggregations to leverage the type-safety of Kotlin for paths references in Spring Data MongoDB.

A similar implementation is offered by the now deprecated project KMongo, see KPropertyPath.kt and Properties.kt.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 21, 2023
@christophstrobl christophstrobl added the in: kotlin Kotlin support label Dec 21, 2023
@mp911de
Copy link
Member

mp911de commented Dec 27, 2023

Care to submit a pull request?

@mp911de mp911de added status: ideal-for-contribution An issue that a contributor can help us with type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: kotlin Kotlin support status: ideal-for-contribution An issue that a contributor can help us with type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants