question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

List<Map<String, String>> in models not rendered correctly

See original GitHub issue

Hi,

I have the following issue : one of my models has an attribute List<Map<String,String>>. It is rendered as

items: {
$ref: "#/definitions/Map«string,string»"
}

in the swagger.json. The problem is that not only it is not valid, but it doesn’t help at all to describe the attribute. As seen in swagger-editor online, the problem is Definition could not be resolved: #/definitions/Map«string,string» I have looked at alternateTypeRules and directModelSubstitute when creating the docket, but I haven’t found how to solve this. I’ve also tried datatype attribute for @ApiModelProperty. Moreover, it would be perfect if I could describe it more precisely, such as

[{"id":"aeiuo"}]

Is there any way first to fix the json ? Also, is there anything I could do to describe more precisely this attribute ? I’ve already put this in the description, so this part of my issue is less important.

Thanks

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
charithan1commented, May 31, 2019

Is this bug fixed? If yes, which version is it available?

0reactions
vpm911commented, Jun 24, 2020

Is this bug fixed? I have a private Map<String, Map<String, List<Thumbnail>>> thumbnails; which is causing the following json to be generated

"MapOfstringAndListOfThumbnail": { "type": "object", "title": "MapOfstringAndListOfThumbnail", "additionalProperties": { "$ref": "#/definitions/List" } } and the $ref: “#definitions/List” is not present in the documentation. This is causing Semantic error at definitions.MapOfstringAndListOfThumbnail.additionalProperties.$ref $refs must reference a valid location in the document

Read more comments on GitHub >

github_iconTop Results From Across the Web

HashMap of ArrayList<String>, String is not working properly?
So , I want to make a map of Lists of Strings to Strings, but I cannot get it to work properly: this...
Read more >
Map or String: what do I have to use?
Using a map like that obfuscates the parameters, making it so developers have to read the method to know what parameters to use....
Read more >
Solved: Sightly : How to Iterate through Map<String , Map...
Solved: Backed code submits an object as : HashMap map= new HashMap (); In Sightly how can I access Key, Values of the...
Read more >
The Map Interface (The Java™ Tutorials > Collections ...
A Map is an object that maps keys to values. A map cannot contain duplicate keys: Each key can map to at most...
Read more >
Working with items: Java - Amazon DynamoDB
The SDK for Java also provides an object persistence model, allowing you to map ... //Build a map of product reviews Map<String, List<String>>...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found