Skip to content

java.lang.Object converted to json object (map) type #4906

Open
@Rivatus

Description

@Rivatus

Duplicate of issue: #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.Object to type: object
public 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions