Skip Unescaping on POST request

18 views
Skip to first unread message

Stefaan Delanghe

unread,
Feb 10, 2017, 7:35:31 AM2/10/17
to finatra-users
Hi,

I have a case class ...

case class PersonPost(
@JsonProperty("firstName"firstName : String, 
@JsonProperty("lastName"lastName : String, 
@Inject request: Request
)

used in a post ...

post("/person") { request : PersonPost =>
 ....
}

Now when i get i call with holds following data

{
  "firstName" : "J\'ohn"
  "lastName": "Smith"
}


I get a 400 back with following error
"Unrecognized character escape ''' (code 39)"


I don't want that the characters are escaped on entry. I want to hold the string as it is.
How can i accomplish this?

Thanks

Christopher Coco

unread,
Feb 10, 2017, 9:40:22 PM2/10/17
to Stefaan Delanghe, finatra-users
I believe you can mark it with @JsonRawValue.


--
You received this message because you are subscribed to the Google Groups "finatra-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to finatra-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Stefaan Delanghe

unread,
Feb 10, 2017, 10:00:30 PM2/10/17
to finatra-users
I have tried that result was the same.

case class definition was
case class PersonPost(

@JsonRawValue @JsonProperty("firstName") firstName : String,

@JsonRawValue @JsonProperty("lastName") lastName : String,

@Inject request: Request

)

Reply all
Reply to author
Forward
0 new messages