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

Deal with __fake_root #99

Open
masojus opened this issue May 17, 2017 · 1 comment
Open

Deal with __fake_root #99

masojus opened this issue May 17, 2017 · 1 comment

Comments

@masojus
Copy link
Collaborator

masojus commented May 17, 2017

In order to deal with HTTP responses that can contain either a root JSON Object or a root JSON Array, at a low level we have to check the structure and either return a Map<> or a List<>. That fundamentally changes some of the core code across the SDK, so we added __fake_root to circumvent this without a breaking change.

Look at addressing this in a better way with a breaking change for the next major version bump.

@masojus
Copy link
Collaborator Author

masojus commented May 17, 2017

From PR #96 :

        // TODO : We can't assume the top-level node is a JSON Object anymore, because parts of the
        // API we access return a JSON Array as the root. So we need to detect the type and decide
        // what to return, so we need a different return type. Technically it could be a List or
        // Map, so it should be Object, then client code would need to do the instanceof check. For
        // now, so as to not break the KeenJsonHandler interface, we can we can stick a dummy "root"
        // key in the map we pass back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant