Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json4s marshaller also provided for () it seems #52

ktoso opened this issue Feb 15, 2016 · 2 comments

json4s marshaller also provided for () it seems #52

ktoso opened this issue Feb 15, 2016 · 2 comments


Copy link

@ktoso ktoso commented Feb 15, 2016

As found in

The confusion:

Unfortunately, Akka Http resolves complete(Future(())) with an http response with code 200 and empty body — same as complete(Future(None))! Please, put a comment below if you know the rationale behind this design choice.

The reason:

It picks up de.heikoseeberger.akkahttpjson4s.Json4sSupport#json4sMarshaller for Unit as well, causing unexpected outcome. I see it may be tough to change the types around given how this works here but worth pointing out or thinking about perhaps.

Copy link

@hseeberger hseeberger commented Feb 15, 2016

See #49. This is due to Json4s being a crappy library.

@hseeberger hseeberger closed this Feb 15, 2016
jrudolph referenced this issue in DanielaSfregola/quiz-management-service Feb 16, 2016
Copy link

@jrudolph jrudolph commented Feb 16, 2016

We've stumbled over these kind of things in the past as well (e.g. in spray/spray#990 (comment)). One conservative "solution" would be not to provide any reflection-based implicit marshallers automatically at all. Instead, the developer would need to create a little library of domain type marshallers as suggested by @sirthias in the above thread.

I.e. json4sMarshaller is either made not implicit or at least it is not imported and the user then creates tightly scoped implicits with

implicit def fooFormat = json4sMarshalling[Foo]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants