-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Added GenerateClients options for seperate generation #436
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #436 +/- ##
==========================================
+ Coverage 95.41% 95.45% +0.03%
==========================================
Files 70 70
Lines 3406 3412 +6
==========================================
+ Hits 3250 3257 +7
Misses 114 114
+ Partials 42 41 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff @berkslv
Thanks for being thorough by updating the docs and tests
I pulled your branch and tried it out locally to review. There is, unfortunately, one thing you missed, and as it is right now, the generated code will not build because the System.Text.Json.Serialization
has not been imported
To fix this, you need to update RefitGenerator
and replace lines 128-132
var contracts = RefitInterfaceImports
.GetImportedNamespaces(settings)
.Aggregate(
generator.GenerateFile(),
(current, import) => current.Replace($"{import}.", string.Empty));
with
var contracts = generator.GenerateFile();
if (settings.GenerateClients)
{
contracts = RefitInterfaceImports
.GetImportedNamespaces(settings)
.Aggregate(
contracts,
(current, import) => current.Replace($"{import}.", string.Empty));
}
@all-contributors please add @berkslv for ideas and code |
I've put up a pull request to add @berkslv! 🎉 |
Quality Gate passedIssues Measures |
I have completed the changes you requested @christianhelle Thank you for adding me as a contributor, I follow this repo closely in the future and try to add value to it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works fine and looks good
Thank you for your contribution @berkslv |
I added generateClients options to generate seperate client and contracts. Also add 1 test for this feature