Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hazraarka072 opened this issue May 26, 2020 · 5 comments
Labels
feedback provided Feedback has been provided to the author

Comments

@hazraarka072
Copy link

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.

@kdavisk6
Copy link
Member

@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 kdavisk6 added the feedback provided Feedback has been provided to the author label May 30, 2020
@kdavisk6
Copy link
Member

@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.

@ojha583
Copy link

ojha583 commented Mar 29, 2021

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

@thepickpocket
Copy link

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

@JKomoroski
Copy link
Contributor

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 #1464

I believe this can be closed @kdavisk6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback provided Feedback has been provided to the author
Projects
None yet
Development

No branches or pull requests

5 participants