Skip to content

Instantly share code, notes, and snippets.

@AdamBien
Last active July 17, 2017 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdamBien/974714ccaf26033697e9 to your computer and use it in GitHub Desktop.
Save AdamBien/974714ccaf26033697e9 to your computer and use it in GitHub Desktop.
20thAirhacksQ&A.md
@bogeskov
Copy link

bogeskov commented Nov 9, 2015

Hello Adam

You've previously show neat tricks, like marshalling/unmarshalling json to pojo's.

Staying in the json realm :

Do you have an easy way to validate input/output (@XmlRootElements), when calling method annotated like this:

    @POST
    @Path("/")
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public Out method(In in) {
...

Having looked at examples, I hope I've missed a trick - you can't have to jump through all those hoops.

It would be nice to know that when the method is invoked, all required fields are populated (doing null pointer checks, feels like you're doing it wrong).

See You

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