Skip to content

RegisterBodyDecoder for text/csv #696

@cosma

Description

@cosma

Hello, I implemented your library and I have when I upload a csv file. error in openapi3filter.RequestError: request body has an error: failed to decode request body: path file: unsupported content type "text/csv"

Could you also please register a body decoder for CSV files RegisterBodyDecoder("text/csv", csvBodyDecoder)

func init() {
RegisterBodyDecoder("text/plain", plainBodyDecoder)
RegisterBodyDecoder("application/json", jsonBodyDecoder)
RegisterBodyDecoder("application/x-yaml", yamlBodyDecoder)
RegisterBodyDecoder("application/yaml", yamlBodyDecoder)
RegisterBodyDecoder("application/problem+json", jsonBodyDecoder)
RegisterBodyDecoder("application/x-www-form-urlencoded", urlencodedBodyDecoder)
RegisterBodyDecoder("multipart/form-data", multipartBodyDecoder)
RegisterBodyDecoder("application/octet-stream", FileBodyDecoder)
}

Any help is super appreciated!
Thanks in advanced and this is quite urgent.

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