Skip to content

render-seq-generic strange behaviour for "text/html" "text/plain" "text/csv" #297

@petoalbert

Description

@petoalbert

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions