jdereg / json-io

Convert Java to JSON. Convert JSON to Java. Pretty print JSON. Java JSON serializer. Deep copy Java object graphs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

User guide Untyped Usage

Amosnomor opened this issue · comments

The user guide section for untyped usage says:

    String json = // or InputStream to JSON providing source
    ReadOptions readOptions = new ReadOptionsBuilder().returnAsNativeJsonObjects().build();
    Map root = JsonIo.toObjects(json, readOptions);  

But JsonIo.toObjects() currently requires a third parameter, rootType. Looking at the TestUtil.java shows it passing null for this case:

    public static JsonObject toObjects(InputStream in, ReadOptions readOptions) {
        return JsonIo.toObjects(in, readOptions, null);
    }

Should there be another signature without the rootType parameter? Or will passing null need to be documented? Or?

Good catch. Passing in null is documented in the JavaDocs, however, I will add a root class to the example.