I im declaring two post methods. One for saving one object and another for saving a list. Now the question is what path should i give to each one in order to not get the typical error :
Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map My controller has the following url, for instance /faults
These are my methods:
@PostMapping
public ResponseEntity<FaultDTO> save(@RequestBody FaultDTO faultDTO){...}
@PostMapping
public ResponseEntity<List<FaultDTO>> saveAll(@RequestBody ArrayList<FaultDTO> list){...}
What are the correct way of write this api?