swagger-api / swagger-codegen

swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
http://swagger.io
Apache License 2.0
17.09k stars 6.03k forks source link

[Python][raw string]bad pattern with raw string #9398

Open nicho2 opened 5 years ago

nicho2 commented 5 years ago

[Python][raw string]bad pattern with raw string

Description

raw string is not correctly used

Swagger-codegen version

2.4.4 it is a regression

Swagger declaration file content or url
Command line used for generation
Steps to reproduce

previous version: re.search('^[\w\s:.,_-]*$', "UNITEST") answer:<_sre.SRE_Match object at 0x132DE800>

this version: re.search(r'^[\w\s:.,_-]*$', "UNITEST") no match because raw string is used but too more \

Related issues/PRs
Suggest a fix/enhancement

the good way is : re.search(r'^[\w\s:.,_-]*$', "UNITEST")

vnitinv commented 4 years ago

@nicho2 Can you read your description again, looks something is wrong. No match regex is working one.