skip to Main Content

Why does Python Flask convert lists of dicts in JSON to a string of just the first item in the list, or just its keys?

Flask in Python is converting all of my lists to strings. Here is my code: class OpenAI(Resource): # methods go here def post(self): parser = reqparse.RequestParser() # initialize parser.add_argument('model', type=str, required=True) # add arguments parser.add_argument('conversation', type=list, required=True) parser.add_argument('functions', type=list, required=False)…

VIEW QUESTION

Spring Boot controller to handle invalid JSON

I have a Spring Boot controller that consumes JSON: @PostMapping( value = "/shipdetails") public ResponseEntity acceptShip(@RequestBody Ship ship, HttpServletRequest request) { shipService.checkShip(ship); return new ResponseEntity<>(HttpStatus.OK); } There is a corresponding Ship Entity: public class Ship implements Serializable { @JsonProperty("Name") private…

VIEW QUESTION
Back To Top
Search