L'exemple JSON du module Enunciate docs affiche des cartes sous la forme d'un tableau d'objets.Enunciate Exemple JSON affiche Maps as Array
Par exemple, j'ai un objet comme:
@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; }
}
L'exemple JSON de enunciate ressemble:
{
"name" : "John Doe",
"attributes" : [{
"..." : ...
},{
}]
}
Je me attends à l'exemple JSON pour ressembler à:
{
"name" : "John Doe",
"attributes" : {
"..." : ...,
}
}
Il semble que le GenerateExampleJsonMethod crée toujours un ArrayNode lorsqu'il voit une Map. Y a-t-il un moyen d'obtenir le JSON attendu?
J'utilise la version 1.26.2 enunciate