-
Notifications
You must be signed in to change notification settings - Fork 33
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
feat: add StringEnum<TEnum>
#98
Conversation
f1f4604
to
46cb083
Compare
4b33c6e
to
24cc656
Compare
@martincostello I think this is ready for review |
src/Octokit.Webhooks/Converter/StringEnumEnumerableConverter.cs
Outdated
Show resolved
Hide resolved
src/Octokit.Webhooks/Converter/StringEnumEnumerableConverter.cs
Outdated
Show resolved
Hide resolved
test/Octokit.Webhooks.Test/Converter/JsonStringEnumMemberConverterWithFallbackTests.cs
Show resolved
Hide resolved
Thanks for the review @martincostello! There are a couple of model updates that I'd like to merge and get into a patch release, before merging this and cutting a major release. |
d9e4879
to
921f0a9
Compare
c6ba481
to
14439bc
Compare
14439bc
to
9afd8cb
Compare
741c958
to
231c4d4
Compare
231c4d4
to
de1ea66
Compare
de1ea66
to
37570d5
Compare
I pushed an update, but it looks like the PR isn't receiving updates 😢 |
5a326ef
to
f9f5885
Compare
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.
Thanks for all your work here!
@martincostello I just cut the v2.0.0 release. Can you upgrade and let me know how it goes? |
Sure - I'll poke dependabot on my app and see what happens 😄 |
I just had to make a few minor adjustments to fix the compilation and maintain the behaviour: martincostello/costellobot@3e552ca |
Those changes look like what I would expect. Thanks for all your help with this change! |
This PR adds the
StringEnum<TEnum>
, similar to Octokit's version1. See Octokit documentation for more explanation and reasoning behind this approach2TODO:
IEnumerable<StringEnum<TEnum>>
with a customJsonConvertorFactory
3RefactorToEnumString
andToEnum
helper methods to extension methods (or somewhere else)StringEnumConverter
(orStringEnumConverterFactory
) testsCloses #90
Footnotes
https://github.com/octokit/octokit.net/blob/5fe3ea82f03b7fe64bcf8145f3b127fa2c585665/Octokit/Models/Response/StringEnum.cs#L11 ↩
https://github.com/octokit/octokit.net/blob/main/docs/working-with-enums.md ↩
https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-converters-how-to?pivots=dotnet-6-0#sample-factory-pattern-converter ↩