Closed jhomarolo closed 3 years ago
When I use
var especie = Especie.fromJSON(ctx.req)
, the id field comes empty if I do not pass the value of id in the parameter of fromJSON function.
It is not clear what is the value of ctx.req
. Could you make it explicit?
In that case would be the hole entity, except the field id
{
"puData":"2021-06-0T00:00:00.000Z",
"pagamentoJuros":3.0,
"puAmortizacao":1.2,
"pagamentoTotal":360,
"puCheio":1165.77523304,
"puVazio":1165.77523304,
"puJuros":15.55861897
}'
Describe the bug
Given my entity:
When I use
var especie = Especie.fromJSON(ctx.req)
, the id field comes empty if I do not pass the value of id in the parameter of fromJSON function.I believe that is a bug, since gotu returns a new instance from this object within the values were send to the function.
Expected behavior When I use fromJSON all default variables that are not passed through the function, are filled with the respective default values
Additional context This, could be a flag optional or not inside the fromJSON function or inside de default value, maybe.