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

Add ability to ignore enum cases with associated values #13

Merged
merged 1 commit into from
Feb 8, 2022

Conversation

Supereg
Copy link
Member

@Supereg Supereg commented Feb 8, 2022

Add ability to ignore enum cases with associated values

♻️ Current situation & Problem

Currently, the TypeInformation framework will reject parsing any enums which contain enum cases with associated values.
This is e.g. a problem in the gRPC exporter, where every enum has a fallback case to support parsing unknown enum values.

💡 Proposed solution

This PR adds the ability to ignore enum cases with associated values instead of rejecting the enum completely. In our case this is fine, as the UNRECOGNIZED case shouldn't be handled anyway. The new option allows to easily add support for parsing those enum cases.

⚙️ Release Notes

  • Added ability to parse enums with enum cases with associated values by ignoring them.

➕ Additional Information

Related PRs

Testing

Additional testing was added.

Reviewer Nudging

--

Code of Conduct & Contributing Guidelines

By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

@codecov
Copy link

codecov bot commented Feb 8, 2022

Codecov Report

Merging #13 (bcbbda9) into develop (ab8fd4f) will decrease coverage by 0.20%.
The diff coverage is 57.15%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #13      +/-   ##
===========================================
- Coverage    82.12%   81.93%   -0.19%     
===========================================
  Files           31       31              
  Lines         1599     1604       +5     
===========================================
+ Hits          1313     1314       +1     
- Misses         286      290       +4     
Impacted Files Coverage Δ
...iniTypeInformation/Init/TypeInformation+Init.swift 44.52% <55.56%> (+1.85%) ⬆️
...podiniTypeInformation/Builder/RuntimeBuilder.swift 100.00% <100.00%> (ø)
Sources/ApodiniTypeInformation/EnumCase.swift 64.00% <0.00%> (-16.00%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ab8fd4f...bcbbda9. Read the comment docs.

@Supereg Supereg merged commit 8d73533 into develop Feb 8, 2022
@Supereg Supereg deleted the feature/associated-values-handling branch February 8, 2022 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant