stargate / data-api

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

SERVER_UNHANDLED_ERROR if collection name is a list (during createCollection) #1240

Closed hemidactylus closed 5 days ago

hemidactylus commented 4 months ago

Try passing a list of strings as name for createCollection and this is what comes back:

{"message":"Server failed: root cause: (com.fasterxml.jackson.databind.exc.MismatchedInputException) Cannot deserialize value of type `java.lang.String` from Array value (token `JsonToken.START_ARRAY`)\n at [Source: (ByteArrayInputStream); line: 1, column: 29] (through reference chain: io.stargate.sgv2.jsonapi.api.model.command.impl.CreateCollectionCommand[\"name\"])","errorCode":"SERVER_UNHANDLED_ERROR"}

From the caller's perspective I'd say this can be improved (consider Python makes it too easy to just forget a comma at the end of the COLLECTION_NAME = "abc" statement in your script, for example)

tatu-at-datastax commented 2 months ago

@hemidactylus would it be easy to get actual JSON being sent, to make it easier to reproduce with an unit/integration test?