feign icon indicating copy to clipboard operation
feign copied to clipboard

Getting java.util.regex.PatternSyntaxException: Illegal repetition whenever I am trying to pass nested json string in my request header

Open hazraarka072 opened this issue 5 years ago • 5 comments

I am using open feign to communicate to rest endpoints from a spring boot application. In the feign client declaration I am using spring web annotation such as @RequestHeader and @GetMapping. Now in the param which is annotated with @RequestHeader, if i pass one level json String like {"attr1": "value1" , "attr2" : "value2"} the rest calls flows to the target application. But if I pass any nested json like {"attr1": {"attr2" : "value2"}} , the code fails with the below error

Getting java.util.regex.PatternSyntaxException: Illegal repetition.

hazraarka072 avatar May 26 '20 10:05 hazraarka072

@hazraarka072

Without a Minimal, Reproducible Example, I'm not sure if we can clearly say the issue is on our side.

I recommend asking this question first with Spring Cloud OpenFeign, since you are using their contract. If they determine that the issue is a pass-through to OpenFeign, please provide an example of the issue and we will investigate.

kdavisk6 avatar May 30 '20 12:05 kdavisk6

@hazraarka072 This was corrected in #1203. The issue was that headers were being processed twice, resulting in double expansion. Please try the latest version of OpenFeign and report back.

kdavisk6 avatar Dec 29 '20 17:12 kdavisk6

Hi @kdavisk6 , Issue still persist with 11.1 tag and as i could see the commit in #1230 was removed as part of conflict fix #1270

Thanks, Arvind Ojha

ojha583 avatar Mar 29 '21 07:03 ojha583

Hi there, I was getting the same kind of exception, however I could bypass the exception by simply moving around the json properties.

{"property1": {"subProperty": ""}, "basicProperty": ""} <-- causes java.util.regex.PatternSyntaxException {"basicProperty": "","property1": {"subProperty": ""}} <-- accepted as fine

thepickpocket avatar May 26 '21 10:05 thepickpocket

Here's another issue this looks like another json header issue fixed in master at HEAD now. Related to the fixes that came in for https://github.com/OpenFeign/feign/issues/1464

I believe this can be closed @kdavisk6

JKomoroski avatar Oct 22 '22 01:10 JKomoroski