swagger-core
swagger-core copied to clipboard
java.lang.Object converted to json object (map) type
Duplicate of issue: https://github.com/swagger-api/swagger-core/issues/3834, which was closed without proper resolution.
The issue referenced, still exists with version 2.2.32:
The actual behavior:
- Swagger model converter maps
java.lang.Objecttotype: objectpublic class Foo { private Object bar; public static void main(String[] args) throws Exception { ResolvedSchema schema = ModelConverters.getInstance() .resolveAsResolvedSchema( new AnnotatedType(Foo.class)); String value = Json.mapper().writerWithDefaultPrettyPrinter().writeValueAsString(schema.schema); System.out.println(value); } }prints:
{ "type" : "object" }
I used the version 2.2.32 and still got same result.
Can confirm, I also set explicit-object-schema to false and it still doesn't work.