Skip to content

Commit

Permalink
bean parser fails on empty parameters fix #550
Browse files Browse the repository at this point in the history
  • Loading branch information
jknack committed Nov 9, 2016
1 parent ac9ccee commit b2f4652
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
26 changes: 26 additions & 0 deletions coverage-report/src/test/java/org/jooby/issues/Issue550.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.jooby.issues;

import org.jooby.test.ServerFeature;
import org.junit.Test;

public class Issue550 extends ServerFeature {

public static class Person {
public String name;
}

{
get("/550", req -> {
return req.params(Person.class).name;
});
}

@Test
public void shouldIgnoreEmptyParams() throws Exception {
request()
.get("/550?name=pedro&person.sync")
.expect("pedro")
.expect(200);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,10 @@ private List<BeanPath> compile(final Iterator<String> it, final TypeLiteral bean
}
cpath = getter;
}
chain.add(cpath);
ittype = TypeLiteral.get(cpath.type());
if (cpath != null) {
chain.add(cpath);
ittype = TypeLiteral.get(cpath.type());
}
}

// set path
Expand Down

0 comments on commit b2f4652

Please sign in to comment.