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

Fix for Optional request bodies #1530

merged 1 commit into from May 10, 2017

Fix for Optional request bodies #1530

merged 1 commit into from May 10, 2017


Copy link

@ssalinas 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

Copy link

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.

Copy link
Member Author

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.

Copy link

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 merged commit 78fd166 into master May 10, 2017
@ssalinas ssalinas deleted the npe_fix branch May 10, 2017 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

singularity 0.15.0 NPE on DELETE /tasks/task/<id> with no body
3 participants