-
Notifications
You must be signed in to change notification settings - Fork 3
Update builder extension docs with new template #181
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
Conversation
|
📝 Documentation updates detected! New suggestion: Add Java SDK builder extensibility documentation with Template Method pattern |
| ## Adding custom client configuration | ||
|
|
||
| When you need to intercept and transform client configuration before the SDK client is created, you can extend the generated builder classes. This allows you to add custom code and logic during the client initialization process. | ||
| The Java SDK generator now supports builder extensibility through a template method pattern. By extending the generated builder classes and overriding protected methods, you can customize how your SDK client is configured without modifying generated code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: lets delete now since these docs will be forever
| ``` | ||
|
|
||
| ### Create a custom builder with your transformation logic | ||
| ### Create a custom builder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: lets add class Create a custom builder class
|
|
||
| ### Update `.fernignore` | ||
|
|
||
| Add the `MyClient.java` and `MyClientBuilder.java` to `.fernignore`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By adding these two files to .fernignore, fern will not update them on new generations.
| @Override | ||
| protected void setEnvironment(ClientOptions.Builder builder) { | ||
| String baseUrl = this.environment.getUrl(); | ||
| String tenantUrl = baseUrl.replace("/api/", "/api/tenants/" + tenantId + "/"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: lets get rid of the duplicative api
New pattern introduced here which we need to update fern-api/fern#8372