KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm having issues using Jackson to map a Javascript posted JSON array of hashes (Tag). Here is the data received by the controller @RequestBody (It is send with correct json requestheader): [{name=tag1}, {name=tag2}, {name=tag3}] Here is the controller: @RequestMapping(value = "purchases/{purchaseId}/tags", method = RequestMethod.POST, params = "manyTags") @ResponseStatus(HttpStatus.CREATED) public void createAll(@PathVariable("purchaseId") final Long purchaseId, @RequestBody final List<Tag> entities) { Purchase purchase = purchaseService.getById(purchaseId); Set<Tag> tags = purchase.getTags(); purchaseService.updatePurchase(purchase); } When I debug and view the 'entities' value it shows as an ArrayList of generic objects, not as a list of objects of type 'Tag' as I would expect. How can I get jackson to map a passed array of objects to a list of obejcts of type 'Tag'? Thanks
Tags (comma-separated)
Save Edits
Cancel