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

Client.Builder class should use reasonable defaults, or fail-fast #76

Open
kenmccracken opened this issue Nov 22, 2019 · 0 comments
Open

Comments

@kenmccracken
Copy link
Contributor

Currently, the Client.Builder() class allows you to construct an instance without specifying, for example, a Serializer. The result is you get what appears to be a valid Client, but later when you send requests, they fail at the serialization step with a NullPointerException.

A Client instance that can be constructed, but cannot be used, is rather of pointless.

The solution should either

  1. Have the Client.Builder use reasonable defaults, such as apache HttpProvider, NoAuthorizer, and JacksonSerializer, when no override was specified.
  2. Have the Client.Builder.build() method validate not null with assertions that fail-fast and a clear null indicator.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant