swagger-api / swagger-ui

Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
https://swagger.io
Apache License 2.0
26.61k stars 8.97k forks source link

Jackson-databind reflection problem with swagger-ui #10220

Open mebigfatguy opened 3 days ago

mebigfatguy commented 3 days ago

Using swagger-ui version 2.2.26 and jackson-databind version 2.18.1, on jdk21, i get tons of these errors..

ERROR io.swagger.v3.core.jackson.ModelResolver - Neither 'findJsonValueMethod' nor 'findJsonValueAccessor' found in jackson BeanDescription. Please verify your Jackson version.

When i look in jackson-databind, findJsonValueMethod has indeed been recently removed but i do see

/**
 * Method for locating accessor (readable field, or "getter" method)
 * that has
 * {@link com.fasterxml.jackson.annotation.JsonValue} annotation,
 * if any. If multiple ones are found,
 * an error is reported by throwing {@link IllegalArgumentException}
 *
 * @since 2.9
 */
public abstract AnnotatedMember findJsonValueAccessor();

So i was wondering if anyone could tell me what i am doing wrong here?? (it would also be nice to log beanDesc.getClass().getClassName() in that error message.)

funfried commented 21 hours ago

I have the same issue, it seems it's related to having webflux and webmvc libraries inside the classpath (which is not good and I have to fix that in my case sometime), but what's strange is that the error message disappears when downgrading back to swagger 2.2.25 still having webflux and webmvc in my classpath.