github-api icon indicating copy to clipboard operation
github-api copied to clipboard

Compatibility issue with Jackson 2.20 and above

Open yeikel opened this issue 1 month ago • 0 comments

Describe the bug

I am trying to use the project along with Jackson 2.20.1 but it fails at runtime with the following issue while creating the mapper

Exception in thread "main" java.lang.NoSuchFieldError: Class com.fasterxml.jackson.databind.PropertyNamingStrategy does not have member field 'com.fasterxml.jackson.databind.PropertyNamingStrategy SNAKE_CASE'
	at org.kohsuke.github.GitHubClient.<clinit>(GitHubClient.java:98)

To Reproduce Steps to reproduce the behavior:

  1. Configure a project and add Jackson 2.20.1 to the classpath
  2. Try to create a new client

Expected behavior

The client is created

Actual behavior

It fails because it cannot find PropertyNamingStrategy SNAKE_CASE which no longer exists

Desktop (please complete the following information):

  • Version: 2.0-rc.5

Additional context

Usage: https://github.com/hub4j/github-api/blob/9e09d67fbb35808abc0782e7d0cbf4b6e64a94de/src/main/java/org/kohsuke/github/GitHubClient.java#L124

This feature was dropped in Jackson 2.20. Using Jackson 2.19.4 works for now but it is not a long term solution

See https://github.com/FasterXML/jackson-databind/commit/4d2083160fef06e6063a3082f0fdaab8c2803793

yeikel avatar Nov 26 '25 18:11 yeikel