Lets take the following resource to demonstrate the problem:
(defresource my-resource
:available-media-types ["text/plain" "text/html" "text/csv" "application/json"]
:available-charsets ["utf-8"]
:handle-ok ["wow" "cool"])
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:
|
(defmethod render-seq-generic "text/plain" [data context] |
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
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: CharacterWith "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-generictrying to interpret theirdataargument as a sequence of Maps for these MIME types, but I cannot imagine why.For example,
render-seq-genericfor "text/plain" directly callsrender-map-genericon 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-resourceat/drag-drop/athletes