@@ -211,6 +211,33 @@ public GitHubBuilder clone() {
211211 }
212212 }
213213
214+ /**
215+ * Configures the client to use Jackson 3.x for JSON serialization/deserialization.
216+ *
217+ * <p>
218+ * By default, Jackson 2.x is used. Call this method to use Jackson 3.x instead.
219+ * </p>
220+ *
221+ * <h3>Example</h3>
222+ *
223+ * <pre>
224+ * GitHub github = new GitHubBuilder().withOAuthToken("token").useJackson3().build();
225+ * </pre>
226+ *
227+ * <p>
228+ * <strong>Note:</strong> To use Jackson 3.x, you must add the Jackson 3 {@code tools.jackson.core:jackson-databind}
229+ * dependency to your project.
230+ * </p>
231+ *
232+ * @return the GitHubBuilder
233+ * @throws IllegalStateException
234+ * if Jackson 3.x is not available on the classpath
235+ */
236+ public GitHubBuilder useJackson3 () {
237+ this .jackson = DefaultGitHubJackson .createJackson3 ();
238+ return this ;
239+ }
240+
214241 /**
215242 * Adds a {@link GitHubAbuseLimitHandler} to this {@link GitHubBuilder}.
216243 * <p>
@@ -282,38 +309,6 @@ public GitHubBuilder withEndpoint(String endpoint) {
282309 return this ;
283310 }
284311
285- /**
286- * Configures which Jackson implementation to use for JSON serialization/deserialization.
287- *
288- * <p>
289- * By default, Jackson 2.x is used. To use Jackson 3.x, create a Jackson 3 instance using
290- * {@link DefaultGitHubJackson#createJackson3()} and pass it to this method.
291- * </p>
292- *
293- * <h3>Example: Using Jackson 3.x</h3>
294- *
295- * <pre>
296- * GitHub github = new GitHubBuilder().withOAuthToken("token")
297- * .withJackson(DefaultGitHubJackson.createJackson3())
298- * .build();
299- * </pre>
300- *
301- * <p>
302- * <strong>Note:</strong> To use Jackson 3.x, you must add the Jackson 3 {@code tools.jackson.core:jackson-databind}
303- * dependency to your project.
304- * </p>
305- *
306- * @param jackson
307- * the Jackson implementation to use
308- * @return the GitHubBuilder
309- * @see DefaultGitHubJackson#createJackson2()
310- * @see DefaultGitHubJackson#createJackson3()
311- */
312- public GitHubBuilder withJackson (GitHubJackson jackson ) {
313- this .jackson = jackson ;
314- return this ;
315- }
316-
317312 /**
318313 * With jwt token GitHubBuilder.
319314 *
0 commit comments