eclipse-ee4j / eclipse-ee4j/jersey

Bean attribute not correctly valorized when boolean and its name is "isSomething"

Open
#3,627 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

Hi,

Dunno if this is a bug or what, but on the server side I have a WS call defined like this:

```@POST
@Path("/simulaFattura")
@Consumes({MediaType.APPLICATION_JSON + "; charset=UTF-8"})
@Produces({MediaType.APPLICATION_JSON + "; charset=UTF-8"})
public FatturaRowBean[] simulaFattura(SimulatorInputBean input) throws Exception
{
```

If i submit data for that Bean "SimulatorInputBean " which has a boolean parameter called "isFixed" via ajax/JSON
with " isFixed : {anyvalue}"
then on the server side i'll always obtain a "isFixed=false" no matter the client value.
I also tried with a int parameter keeping the same name and the result is always "0" no matter the client input value.

By changing the Bean parameter name from "isFixed" to "fixed" i was able to resolve the issue.

So it looks like having a name starting with "is" kinda screw up the Jersey Conversion JSON->BEAN.

Best Regards,

Silvio

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.