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

attempted fix for #196 #197

Merged
merged 1 commit into from
Aug 10, 2024
Merged

attempted fix for #196 #197

merged 1 commit into from
Aug 10, 2024

Conversation

moxplod
Copy link
Contributor

@moxplod moxplod commented Aug 7, 2024

Description

Removing collections from GenerateMappingsRecursive. It is throwing errors as described in the issue. I am not sure if this is the right long term fix. As this removes lists from recursive mappings completely. But since it does not work today anyways, it at least does not throw an exception and I am able to provide a custom mapping for the list in my case.

The error can be seen here - https://dotnetfiddle.net/zO1v3L

Fixes #196

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or that my feature works
  • I have made corresponding changes to the documentation
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes

Copy link

what-the-diff bot commented Aug 7, 2024

PR Summary

  • Added Function to Identify Collections
    A new method named IsCollection has been added to our CollectionTypeHelper.cs file, which resides in the Gridify.Reflection namespace. This function helps to determine whether a certain datatype is a collection or not.

  • Additional Test for Mapping Collections
    An extra test named MapperShouldNotThrowExceptionWhenMappingToCollection has been included in the newly created Issue196Tests.cs file under Gridify.Tests.IssueTests. This test primarily verifies and ensures that the system doesn't encounter any exception when it tries to map to a collection.

  • New Test Class for Issue Testing
    A new class called Issue196TestClass.cs has been added to the Gridify.Tests.IssueTests namespace. This class comprises an attribute CustomFields, which is a compilation of CustomField objects. This helps to experiment and ensure the system's ability to handle list of custom objects.

  • Addition of Custom Fields
    The CustomField.cs file has been introduced within the Gridify.Tests.IssueTests namespace. It carries attributes like Key and Value and an empty constructor, allowing us to handle custom fields in our tests.

Copy link
Owner

@alirezanet alirezanet left a comment

Choose a reason for hiding this comment

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

This is not an ideal fix but for now, you're right, ignoring it is better than exception 👌

@alirezanet alirezanet merged commit 6de9783 into alirezanet:master Aug 10, 2024
3 checks passed
@moxplod moxplod deleted the issue196 branch August 29, 2024 18:49
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.

Generate mapping with maxDepth = 2 and a nested list class causing ArgumentException
2 participants