You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have you provided a full/minimal spec to reproduce the issue? Check below
Have you validated the input using an OpenAPI validator (example)? Yes
What's the version of OpenAPI Generator used? 4.3.1
Have you search for related issues/PRs? Yes
What's the actual output vs expected output?
Example {{{pattern}}} is /\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+/ {{{pattern}}} should be /\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+/
Description
While generating a typescript-axios client, pattern property gets improperly escaped, resulting in a non-valid regular expression. This seems to be caused by toRegularExpression(String pattern)method calling escapeText(String input): overriding the method for TypeScriptAxiosClientCodegen and removing escapeText() call fixes it (I'm raising a PR for this).
Bug Report Checklist
Have you provided a full/minimal spec to reproduce the issue? Check below
Have you validated the input using an OpenAPI validator (example)? Yes
What's the version of OpenAPI Generator used? 4.3.1
Have you search for related issues/PRs? Yes
What's the actual output vs expected output?
Example
{{{pattern}}} is
/\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+/
{{{pattern}}} should be
/\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+/
Description
While generating a typescript-axios client, pattern property gets improperly escaped, resulting in a non-valid regular expression. This seems to be caused by
toRegularExpression(String pattern)
method callingescapeText(String input)
: overriding the method forTypeScriptAxiosClientCodegen
and removing escapeText() call fixes it (I'm raising a PR for this).openapi-generator version
OpenAPI declaration file content or url
Here's a minimal spec to reproduce the issue:
Command line used for generation
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i <...> -g typescript-axios -o test/client -t ./
The text was updated successfully, but these errors were encountered: