Skip to content

Mixing compojure.api.sweet/defapi and compojure.core/defroutes #459

@maksr

Description

@maksr

Library Version(s)

[metosin/compojure-api "1.1.13"]
[compojure "1.6.1"]

Problem

I have two handlers, defined as

(compojure.api.sweet/defapi restful-routes...)
(compojure.core/defroutes public-routes...)

When I combine them with

(compojure.core/routes #'restful-routes #'public-routes)

the POST requests to public routes loose :body parameters. The body comes through as org.eclipse.jetty.server.HttpInputOverHTTP, but it has been read somwhere in the middleware so its content is not available.

I blame compojure.api.sweet for this, because when I reverse the call order to

(compojure.core/routes #'public-routes #'restful-routes)

it works fine, the body streams in POST methods are available in both handlers.

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