[BUG][Python] Some regex patterns can generate invalid code. #6675
Comments
|
Is there any development for this issue? |
|
@hbusul and @RedRoserade do either of you or does anyone else want to fix this? And here is where our regex patterns are placed in the generated python code. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Bug Report Checklist
Description
If a pattern such as
^['"\-\w\s]+$is specified, the generated python code for validation produces a syntax error:However, if it is changed to
^[\'\"\-\w\s]+$, the error then becomes:The pattern
^['\"\-\w\s]+$works, since the generated code has the correct escape sequences, but as far as I can tell, it is equivalent to the others (despite the redundant escapes).openapi-generator version
I'm using version
v4.3.1.OpenAPI declaration file content or url
docker run --rm
-v "$(pwd):/local"
--user="$(id -u):$(id -g)"
-w /local
openapitools/openapi-generator-cli:v4.3.1 generate
-i "swagger.yaml"
-g python
-o .
-c example.json
Related issues/PRs
Suggest a fix
I would like to fix this, if possible.
The text was updated successfully, but these errors were encountered: