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

Fix for Optional request bodies #1530

Merged
merged 1 commit into from May 10, 2017

Conversation

Projects
None yet
3 participants
@ssalinas
Member

ssalinas commented May 8, 2017

Seems that after the jersey/dropwizard upgrade the Optional bodies are not coming through correctly and are null instead of absent() when the body is not present. Updated the impacted endpoints (anything with an Optional body) to take the object (nullable) and construct the Optional afterwards. Actually made the tests look a bit nicer not wrapping everything in Optional.of() too.

I can test this out and try to get a 15.1 out if it looks good.
/cc @darcatron @stevenschlansker @dstryker @pennello @sannessa
/fixes #1525

@ssalinas ssalinas added the hs_staging label May 8, 2017

@pennello

This comment has been minimized.

Show comment
Hide comment
@pennello

pennello May 8, 2017

Thanks @ssalinas. The test cleanup is nice, but it's a disappointing the injection is now a little more cumbersome. I wonder if this is actually intended given the jersey/dropwizard upgrade, or if it's an upstream bug.

pennello commented May 8, 2017

Thanks @ssalinas. The test cleanup is nice, but it's a disappointing the injection is now a little more cumbersome. I wonder if this is actually intended given the jersey/dropwizard upgrade, or if it's an upstream bug.

@ssalinas

This comment has been minimized.

Show comment
Hide comment
@ssalinas

ssalinas May 8, 2017

Member

@pennello , as far as I could tell it was never really documented that an Optional request body was something that was expected to work (at least I couldn't find it on the dropwizard or jersey docs easily). There is a lot around optional *Params and the validation annotations, but not much around actual request bodies.

Member

ssalinas commented May 8, 2017

@pennello , as far as I could tell it was never really documented that an Optional request body was something that was expected to work (at least I couldn't find it on the dropwizard or jersey docs easily). There is a lot around optional *Params and the validation annotations, but not much around actual request bodies.

@stevenschlansker

This comment has been minimized.

Show comment
Hide comment
@stevenschlansker

stevenschlansker May 8, 2017

Contributor

Yeah, I'll second the surprise that the container doesn't do this for you (maybe there's a fix that should go upstream to Jersey?) but obviously I'm in favor of fixing the issue despite uglifying the code :)

Contributor

stevenschlansker commented May 8, 2017

Yeah, I'll second the surprise that the container doesn't do this for you (maybe there's a fix that should go upstream to Jersey?) but obviously I'm in favor of fixing the issue despite uglifying the code :)

@ssalinas ssalinas added the hs_qa label May 8, 2017

@ssalinas ssalinas modified the milestone: 0.15.1 May 8, 2017

@ssalinas ssalinas added the hs_stable label May 9, 2017

@ssalinas ssalinas merged commit 78fd166 into master May 10, 2017

@ssalinas ssalinas deleted the npe_fix branch May 10, 2017

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