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

Auto-detect underlying type for static Any type #18

Closed
denis-zhdanov opened this issue Dec 17, 2019 · 0 comments
Closed

Auto-detect underlying type for static Any type #18

denis-zhdanov opened this issue Dec 17, 2019 · 0 comments
Assignees

Comments

@denis-zhdanov
Copy link
Owner

Problem

We might want to define a generic setup in the target data class, e.g. data class Target(val data: Map<String, Any>. Raw input might look like below:

data:
    key1:
        - listValue1
        - listValue2
    key2: simpleValue1
    key3:
        nestedKey1: mapValue1
        nestedKey2: mapValue2

In this situation, we want to create target instance like below:

Target(mapOf(
    "key1" to listOf("listValue1", "listValue2"),
    "key2" to "simpleValue1",
    "key3" to mapOf(
        "nestedKey1" to "mapValue1",
        "nestedKey2" to "mapValue2"
    )
))

Task

When target static type is defined as Any, be smart enough to pick it up as a String, List<String> or Map<String, Any>

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

No branches or pull requests

1 participant