arsis-dev
arsis-dev

Reputation: 453

Define Enunciate response of Map<String, String>

The closest response data type description I can get is

map of object (JSON)

with a response example of

...

when I use the annotation

@TypeHint(Map.class)

Ideally I need to specify a response type of Map<String, String>, HashMap<String, String>, or something that would provide a response data type that makes sense and a response example similar to

{
    "...": "...",
    "...": "..."
}

Upvotes: -1

Views: 336

Answers (1)

arsis-dev
arsis-dev

Reputation: 453

Found a solution using the @requestExample JavaDoc Tag detailed in the Enunciate documentation.

For example

@responseExample application/json {"..." : "..."}

Gives a proper response example of

{
  "...": "..."
}

Using the @TypeHint(Object.class) annotation produces a response data type of object (JSON), which technically makes sense, so this solution is sufficient.

Upvotes: 0

Related Questions