Skip to content

Add HttpClient as a better name than HttpClientContext with deprecation #57

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

Merged
merged 6 commits into from
Jan 16, 2023

Conversation

rbygrave
Copy link
Contributor

I have convinced myself that HttpClient is a better name than HttpClientContext. This does mean that it has the same short name as the underlying java.net.http.HttpClient but I think that is ok as:

  1. We generally don't need to supply JDK HttpClient but instead just it's builder options (so we very rarely hit the short name collision)
  2. Other projects use HttpClient as their name.

To me it's become really clear that HttpClientContext is a pretty bad name so going for this change. This includes deprecation of HttpClientContext.builder() in favor of HttpClient.builder(). We will keep both for some time to allow people to migrate.

@rbygrave rbygrave self-assigned this Jan 16, 2023
@rbygrave rbygrave added this to the 1.22 milestone Jan 16, 2023
@SentryMan
Copy link
Contributor

Can we perhaps also change the HttpApiProvider interface to use the new superclass? I tried changing the http-client-generator, but got errors.

@rbygrave
Copy link
Contributor Author

I tried changing the http-client-generator, but got errors.

I need to merge this and release this client and then it will work.

also change the HttpApiProvider interface to use the new superclass?

We don't need to immediately as HttpClientContext extends HttpClient so both are expected to work with the generated code as it is (it should support existing client generated code) ... but yes I see that PR and yes we can merge that in once this is released.

@rbygrave rbygrave merged commit 1379563 into master Jan 16, 2023
@rbygrave rbygrave deleted the feature/AddHttpClient branch January 16, 2023 18:31
@SentryMan
Copy link
Contributor

SentryMan commented Jan 16, 2023

I need to merge this and release this client and then it will work.

I mean I had these changes on my local repository and it still doesn't generate

@SentryMan
Copy link
Contributor

hmm, I guess I was wrong, it does work

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

Successfully merging this pull request may close these issues.

2 participants