0

The Example JSON from the Enunciate docs module shows maps as an array of Objects.

For instance, I have an object like:

@JsonRootType
@JsonName("MyObj")
@XmlRootElement
public class MyObject {
  @DocumentationExample("John Doe")
  private String name;
  private Map<String, String> attributes;

  public MyObject() {}

  public String getName() { return name; }
  public Map<String, String> getAttributes() { return attributes; }
}

The Example JSON from enunciate looks like:

{
  "name" : "John Doe",
  "attributes" : [{
    "..." : ...
  },{
  }]
}

I would expect the Example JSON to look like:

{
  "name" : "John Doe",
  "attributes" : {
    "..." : ...,
  }
}

It appears the GenerateExampleJsonMethod is always creating an ArrayNode when it sees a Map. Is there a way to get the expected JSON?

I am using enunciate version 1.26.2

1 Answers1

0

Yeah. That got fixed in 1.27, release pending this week some time.

Ryan Heaton
  • 1,173
  • 7
  • 11