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

Can't add custom values of diferent type #126

Closed
martinblaustein opened this issue May 14, 2018 · 8 comments
Closed

Can't add custom values of diferent type #126

martinblaustein opened this issue May 14, 2018 · 8 comments

Comments

@martinblaustein
Copy link

In launchdarkly app we have a custom rule where a rule can be an int (an id) or a string (a role).

In java it's impossible through the LDUser.Builder to add a List of objects, it only allows a list of String or a list of Number, with the custom, customString and customNumber methods.

There should be a builder.customObject(String k, List vs) in order to allow operations that are allowed through js for example.

@eli-darkly
Copy link
Contributor

Thanks for pointing this out. It's a reasonable request. One thing I'd change slightly would be to make it take a List<JsonElement> rather than a list of Objects; while this means that our API is dependent on Gson's classes, that's been our approach elsewhere in the SDK (i.e. in LDClient.allFlags and LDClient.jsonVariation) when we need to represent an arbitrary value and guarantee that it's a type that can be represented in JSON.

@martinblaustein
Copy link
Author

martinblaustein commented May 14, 2018

while this means that our API is dependent on Gson's classes

Having that into consideration then I believe it would be a good implementation.

Although the LDClient.allFlags actually forced us to import gson to be able to process the result, but it's a very generic dependency :)

@eli-darkly
Copy link
Contributor

We did basically the same thing for .NET, which is the other strongly-typed platform where we use a third-party JSON library. There's no equivalent in Go, so we just use interface{} there even though technically that doesn't guarantee that the value can be marshalled in JSON.

@martinblaustein
Copy link
Author

Do you think the new method will be implemented soon?
If not we will change the values in the launchdarkly app, as a temporary solution.

@eli-darkly
Copy link
Contributor

Should be fairly soon— I'll try for the first half of this week. It's a very simple change with no effect on the rest of the platform.

@martinblaustein
Copy link
Author

AMAZING!

@eli-darkly eli-darkly mentioned this issue May 15, 2018
@eli-darkly
Copy link
Contributor

This has been implemented in the 4.1.0 release. :)

@martinblaustein
Copy link
Author

@eli-darkly Great!

bwoskow-ld added a commit that referenced this issue May 2, 2019
…per build (#126)

* re-introduce ossrh properties which were removed a while back

* adding a comment

* bump felix versions
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

2 participants