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

Service Operator "Flattens" Nested Lists #79

Closed
MatKuhr opened this issue Sep 6, 2021 · 3 comments
Closed

Service Operator "Flattens" Nested Lists #79

MatKuhr opened this issue Sep 6, 2021 · 3 comments

Comments

@MatKuhr
Copy link
Member

MatKuhr commented Sep 6, 2021

Hi colleagues,

we noticed that if a service binding (e.g. identity service) has a property that is an array (e.g. domains), the property will be "flattened" into a single file.

E.g. Identity Service binding on CF:

"credentials": {
            .....
            "domains": [
                "accounts400.ondemand.com"
             ]
}

on K8s we have a file domains containing:

["accounts400.ondemand.com"]

This poses a problem. Because in the “flattened” version applications need to "know" which fields are arrays. An application can’t just assume any value wrapped in [] will be an array, it might also just be part of the value. E.g. a client secret.

For applications, this is at least inconvenient. For libraries & tools, that support various services, it's a slightly bigger problem. Do you think this could be improved in the future?

Kind regards,
Matthias

@MatKuhr
Copy link
Member Author

MatKuhr commented Sep 7, 2021

One additional point: The same problem is also relevant for nested JSON objects.

I don't know how that is handled at the moment, but I would guess:

"credentials": {
            .....
            "some-nested-object": {
                  "key": "val"
             }
} 

would result in a file some-nested-object containing:

{"key": "val"}

Again, with the same problem that we have in the list case.

@MatKuhr
Copy link
Member Author

MatKuhr commented Sep 7, 2021

@jkbschmid was so kind to point me towards this option: #62

We'll try that out as well as a workaround. Still, guidance on a long-term solution would be great

@loewenstein
Copy link

loewenstein commented Sep 8, 2021

@MatKuhr why would you consider #62 as a workaround instead of a solution?

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

3 participants