Definition not created for Map<<String,Object>>
I'm new to Swagger and I have a problem with a definition file generated for one of our services. The endpoint returns a List<Map<String,Object>> where the Object represents columns in a database record. The Swagger definition file defines the response object as:
"responses":{
"200":{
"description":"OK",
"schema":{
"type":"array",
"items":{
"$ref":"#/definitions/Map«string,object»"
}
}
},
"401":{
"description":"Unauthorized"
},
"403":{
"description":"Forbidden"
},
"404":{
"description":"Not Found"
}
},
The $ref definition is not found in the definition file and the file fails validation when validated with swagger-cli. The error message is:
Error resolving $ref pointer "example.json#/definitions/Map«string,object»".
Token "Map«string,object»" does not exist.
Our site admins will not allow definition files that fail this validation to our local SwaggerHub, so this is holding up publishing the API. Does anyone have ideas how to solve this problem and why that token is not created?
Yes, thank you. The thing is, Springfox is not one of our libraries, and we don't know it well enough to provide support for it. It does use our swagger-core annotations, but the parsing of the annotations is done soley by Springfox. There should be a solution for your use case though, so I'd suggest filing a ticket with the project, and hopefully they can help you out.