I'm creating the swagger file for the documentation of the various APi. In a controller I have the case where I request a RequestParam and a RequestBody:
@PostMapping("/message-now/save-with-params")
@Timed(value = MetricsTimerConstants.storeMessageWithParamsTimer)
public ResponseEntity<Object> saveMessageWithParams(@RequestBody Map<String, Object> request,
@RequestParam List<String> params) { .....
Is there a way to define Lists and Maps in OpenApi?I have read the documentation but I can't find a part where they explain how to define the Maps and the Lists in the Swaggers. Thanks so much for the support
Is your question about Swagger Java annotations or about OpenAPI syntax syntax for maps? If the latter, check out these links:
OpenAPI 3.0: Data Types - Arrays
OpenAPI 3.0: Dictionaries, HashMaps and Associative Arrays