You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It works fine for "application/json", but accessing it as "text/plain" leads to the following exception: nth not supported on this type: Character
With "text/csv" and "text/html", I get this: java.lang.Character cannot be cast to java.util.Map$Entry. If I get it correctly, this is caused by the implementations of render-seq-generic trying to interpret their data argument as a sequence of Maps for these MIME types, but I cannot imagine why.
For example, render-seq-generic for "text/plain" directly calls render-map-generic on the sequence items:
The HTML, CSV and TSV rendering provided by render-seq-generic is meant to represent a table of (named) values, so the sequence should look like [{:reaction "wow" :attitude "cool"} {:reaction "nope" :attitude "cool"} {:reaction "haha" :attitude "pleased"}], resulting in the following CSV:
reaction,attitude
wow,cool
nope,cool
haha,pleased
All maps should have identical keys, or at least the keyset of the first element in the seq should be a superset of the rest, otherwise the headers will be broken.
Lets take the following resource to demonstrate the problem:
It works fine for "application/json", but accessing it as "text/plain" leads to the following exception:
nth not supported on this type: Character
With "text/csv" and "text/html", I get this:
java.lang.Character cannot be cast to java.util.Map$Entry
. If I get it correctly, this is caused by the implementations ofrender-seq-generic
trying to interpret theirdata
argument as a sequence of Maps for these MIME types, but I cannot imagine why.For example,
render-seq-generic
for "text/plain" directly callsrender-map-generic
on the sequence items:liberator/src/liberator/representation.clj
Line 154 in 218febd
Can somebody explain to me what the representations for these MIME types are intended to look like?
FYI: I discovered this by running the examples from the project and accessing
athletes-resource
at/drag-drop/athletes
The text was updated successfully, but these errors were encountered: