Pattern must follow the Perl /pattern/modifiers convention. [a-zA-Z0-9_-]+ is not valid
Hello, I'm trying to parse down a api.json schema that was provided with using Python as an input lang. however I fail to do it due to the error mentioned in the headline.
how shall I proceed with debugging it?
hello @Formartha what pattern are you currently using?
Hi @HugoMario, thanks for taking the time to response. That's the swagger schema I'm using.
{ "CmsTenantEntry" : { "type" : "object", "required" : [ "credentialsName", "endpoint", "locationUrl", "name", "type" ], "properties" : { "name" : { "type" : "string", "description" : "Unique logical name", "pattern" : "[a-zA-Z0-9_-]+" }, "type" : { "type" : "string", "description" : "Endpoint type", "pattern" : "[a-zA-Z0-9_-]+" }, "endpoint" : { "type" : "string", "description" : "Endpoint URI", "pattern" : "[a-zA-Z0-9_:/.-]+" }, "credentialsName" : { "type" : "string", "description" : "Logical identifier of credentials entry", "pattern" : "[a-zA-Z0-9_-]+" }, "datacenterId" : { "type" : "string", "description" : "Data center identifier", "pattern" : "[a-zA-Z0-9_-]+" }, "locationUrl" : { "type" : "string", "description" : "Location URL", "pattern" : "[a-zA-Z0-9_:/.-?#]+" } } }
any news? :(
hey @Formartha , yea, sorry for delay, i checked the error and seems to be already handled, what codegen version are you currently using?
@HugoMario @Formartha I have the same issue. Reproducible on v2.4.7. But it works on 2.3.1
weird, anyway, i'm going to assign it to myself and take a time to handled this
I have this issue in 3.0.23, too.
Hello, As mentioned by @pourquoi42 I also face same issue using pattern in versions 3.0.22 and 3.0.23 as well.
Is it a bug? Because the pattern itself is valid but it throws java.lang.IllegalArgumentException: Pattern must follow the Perl /pattern/modifiers convention. ^$|[\w-]{4,32} is not valid. Please help solving this problem.
Please ignore my above comment, I was able to get it working
@rajnamitha and not writing how did you fixed that?
Someone found a solution for this?
Hi @Dovchik, I used "/" at the beginning of the pattern to make it work. This was only to run swagger codegen and then change to original pattern. So it is not a proper solution, hence didn't post it.