2013-01-24 2 views
0

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

Répondre

0

Ouais. Cela a été corrigé en 1.27, la publication est attendue cette semaine.