stargate / data-api

JSON document API for Apache Cassandra (formerly known as JSON API)
https://stargate.io
Apache License 2.0
12 stars 16 forks source link

Change "unparseable JSON" error to HTTP 400 (follow-up to #1200 / #1212) #1216

Open tatu-at-datastax opened 4 days ago

tatu-at-datastax commented 4 days ago

Initial mapping of JsonParseException -- for invalid JSON that cannot be parsed -- is to HTTP 200 with ErrorCode.INVALID_REQUEST_NOT_JSON. But it would make more sense to actually indicate it as HTTP 400 (same ErrorCode) since we cannot actually process is at all, the criteria for returning 200/OK.