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

Java DSL for Marshaller.oneOf() #1551

Closed
n1ko-w1ll opened this Issue Nov 24, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@n1ko-w1ll
Contributor

n1ko-w1ll commented Nov 24, 2017

Hi,
at the moment there is no good Java DSL for using the Marshaller.oneOf(...) for Content Negotiation. In Java I have to use something like

completeOK(entity, Marshaller.oneOf(JavaConverters.asScalaBuffer(Arrays.asList(JacksonJsonSupport.marshaller(), JacksonXmlSupport.marshaller())).toSeq()))

which is not very nice to use. I'd prefer to have it like this:

completeOK(entity, Marshaller.oneOf(JacksonJsonSupport.marshaller(), JacksonXmlSupport.marshaller()))
@n1ko-w1ll

This comment has been minimized.

Show comment
Hide comment
@n1ko-w1ll

n1ko-w1ll Nov 24, 2017

Contributor

I just found out, that the Unmarshaller.firstOf(...) has at least a two parameter version which is missing for Marshaller.oneOf(...).

Contributor

n1ko-w1ll commented Nov 24, 2017

I just found out, that the Unmarshaller.firstOf(...) has at least a two parameter version which is missing for Marshaller.oneOf(...).

@n1ko-w1ll

This comment has been minimized.

Show comment
Hide comment
@n1ko-w1ll

n1ko-w1ll Nov 24, 2017

Contributor

I just submitted PR #1552 to address the issue with two Marshallers.

EDIT: I messed up the commit message at first and had to force push to correct it... sorry for the noise.

Contributor

n1ko-w1ll commented Nov 24, 2017

I just submitted PR #1552 to address the issue with two Marshallers.

EDIT: I messed up the commit message at first and had to force push to correct it... sorry for the noise.

n1ko-w1ll added a commit to n1ko-w1ll/akka-http that referenced this issue Nov 29, 2017

ktoso added a commit that referenced this issue Nov 29, 2017

added Marshaller.oneOf(m1, m2) to JavaDSL (#1551) (#1552)
* added Marshaller.oneOf(m1, m2) to JavaDSL (#1551)

* Fixed indentation of comments #1551

@ktoso ktoso closed this Nov 29, 2017

@ktoso ktoso added this to the 10.0.11 milestone Nov 29, 2017

@ktoso ktoso added the help wanted label Nov 29, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment