Skip to content

Conversation

@code-lucidal58
Copy link
Contributor

@code-lucidal58 code-lucidal58 commented Dec 9, 2020

Fix Rxgen version update

Pattern string ^[a-zA-Z0-9-._:]*$ could not be processed in the 1.1 version of library. The issue was fixed here: curious-odd-man/RgxGen#53

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • If contributing template-only or documentation-only changes which will change sample output, build the project beforehand.
  • Run the shell script ./bin/generate-samples.shto update all Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*. For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

@bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) @bkabrda (2020/01)

@code-lucidal58 code-lucidal58 changed the title [Java][Client]rxgen version update [Java][Client]com.github.curious-odd-man.rgxgen version update Dec 9, 2020
@code-lucidal58 code-lucidal58 marked this pull request as ready for review December 11, 2020 07:39
@code-lucidal58
Copy link
Contributor Author

New error encountered: a testcase failed

[ERROR] Tests run: 1341, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 38.199 s <<< FAILURE! - in TestSuite
[ERROR] testRegularExpressionOpenAPISchemaVersion3(org.openapitools.codegen.python.PythonLegacyClientCodegenTest)  Time elapsed: 0.043 s  <<< FAILURE!
com.github.curiousoddman.rgxgen.parsing.dflt.PatternDoesNotMatchAnythingException:
Before caret only new line is allowed!
'/^patt'
  ^
	at org.openapitools.codegen.python.PythonLegacyClientCodegenTest.testRegularExpressionOpenAPISchemaVersion3(PythonLegacyClientCodegenTest.java:81)

[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR]   PythonLegacyClientCodegenTest.testRegularExpressionOpenAPISchemaVersion3:81 » PatternDoesNotMatchAnything

@spacether
Copy link
Contributor

New error encountered: a testcase failed

[ERROR] Tests run: 1341, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 38.199 s <<< FAILURE! - in TestSuite
[ERROR] testRegularExpressionOpenAPISchemaVersion3(org.openapitools.codegen.python.PythonLegacyClientCodegenTest)  Time elapsed: 0.043 s  <<< FAILURE!
com.github.curiousoddman.rgxgen.parsing.dflt.PatternDoesNotMatchAnythingException:
Before caret only new line is allowed!
'/^patt'
  ^
	at org.openapitools.codegen.python.PythonLegacyClientCodegenTest.testRegularExpressionOpenAPISchemaVersion3(PythonLegacyClientCodegenTest.java:81)

[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR]   PythonLegacyClientCodegenTest.testRegularExpressionOpenAPISchemaVersion3:81 » PatternDoesNotMatchAnything

Can you strip any leading and trailing / and / from the regex pattern before it is passed into rxgen? That will solve this problem.

@spacether spacether added this to the 5.0.0 milestone Dec 16, 2020
Copy link
Contributor

@spacether spacether left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR! This looks great!

@spacether spacether merged commit c2005ca into OpenAPITools:master Dec 16, 2020
@curious-odd-man
Copy link

Hello @spacether and @code-lucidal58.

I've got a feeling that the fix is incorrect:

I think that instead of:

while (pattern.startsWith("/")) pattern = pattern.substring(0, pattern.length()-1);
while (pattern.endsWith("/")) pattern = pattern.substring(1);

there should be:

while (pattern.endsWith("/")) pattern = pattern.substring(0, pattern.length()-1);
while (pattern.startsWith("/")) pattern = pattern.substring(1);

i.e. when ends with slash - truncate from end, when starts with slash - truncate from start.

image

@code-lucidal58
Copy link
Contributor Author

Pardon me for this silly mistake. Here is the edit: #8219

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants