Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed operation name generation names when it has illegal symbols #283

Merged
merged 11 commits into from
Jan 11, 2024

Conversation

yadanilov19
Copy link

Hi!
I faced a compilation problem when the service's swagger didn't have the operationId field in the definition of action and the path had some illegal symbols at the end of it.
For example, the dollar symbol /pet/$illegal-action. Refitter will generate operationName = $iilega-action, which cannot be compiled.
I decided to fix that problem just by using the existing extension method IdentifierUtils.Sanitize that already uses for creation interface name.
I also expanded the Sanitize method to cover more symbols than before.

I hope it will help improve quality of this cool tool!

@christianhelle christianhelle self-assigned this Jan 11, 2024
@christianhelle christianhelle added enhancement New feature, bug fix, or request .NET Pull requests that contain changes to .NET code labels Jan 11, 2024
@christianhelle
Copy link
Owner

@yadanilov19 Thanks for taking the time to implement this. The changes look good to me. Let's get this in as soon as all the PR verifications checks pass

@christianhelle
Copy link
Owner

@all-contributors please add @yadanilov19 for code

Copy link
Contributor

@christianhelle

I've put up a pull request to add @yadanilov19! 🎉

Copy link

codecov bot commented Jan 11, 2024

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (2563fd0) 97.46% compared to head (3433327) 97.39%.
Report is 17 commits behind head on main.

Files Patch % Lines
src/Refitter.Tests/Resources/EmbeddedResources.cs 75.00% 0 Missing and 4 partials ⚠️
src/Refitter.Core/IdentifierUtils.cs 81.25% 3 Missing ⚠️
src/Refitter.Tests/IllegalSymbolsTests.cs 94.73% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #283      +/-   ##
==========================================
- Coverage   97.46%   97.39%   -0.07%     
==========================================
  Files          60       63       +3     
  Lines        2131     2344     +213     
==========================================
+ Hits         2077     2283     +206     
- Misses         37       40       +3     
- Partials       17       21       +4     
Flag Coverage Δ
unittests 97.39% <85.18%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yadanilov19
Copy link
Author

I've made some improvements, but it does do the same)
Sorry for changes after your attention

@christianhelle
Copy link
Owner

I've made some improvements, but it does do the same) Sorry for changes after your attention

@yadanilov19 No problem. Keep them coming as you see fit!

Give me a heads-up when you think you're done and I'll give it another review so we can get the changes in

@christianhelle
Copy link
Owner

@yadanilov19 The unit tests seem to be failing

@yadanilov19
Copy link
Author

@yadanilov19 The unit tests seem to be failing

yeah, I see
I will fix it soon

Copy link

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@yadanilov19
Copy link
Author

I've made some improvements, but it does do the same) Sorry for changes after your attention

@yadanilov19 No problem. Keep them coming as you see fit!

Give me a heads-up when you think you're done and I'll give it another review so we can get the changes in

I guess I'am done.
If tests pass, that means that everything is ready for review.

Copy link
Owner

@christianhelle christianhelle left a comment

Choose a reason for hiding this comment

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

Excellent work @yadanilov19

@christianhelle christianhelle merged commit 5a2c3fb into christianhelle:main Jan 11, 2024
369 of 371 checks passed
@yadanilov19
Copy link
Author

When will a new release be?

@christianhelle
Copy link
Owner

christianhelle commented Jan 12, 2024

When will a new release be?

@yadanilov19 Today. I run a larger set of regression tests before a release, so as soon as this is done running, I will publish a release build to nuget.org

@christianhelle
Copy link
Owner

@yadanilov19 new release: v0.9.4 available from nuget.org

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature, bug fix, or request .NET Pull requests that contain changes to .NET code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants