feign
feign copied to clipboard
Getting java.util.regex.PatternSyntaxException: Illegal repetition whenever I am trying to pass nested json string in my request header
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
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.
@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.
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
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
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