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

[BUG] IEnumerable<int?> get mapped incorrectly. #380

Closed
DumboJet opened this issue Sep 29, 2023 · 0 comments
Closed

[BUG] IEnumerable<int?> get mapped incorrectly. #380

DumboJet opened this issue Sep 29, 2023 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@DumboJet
Copy link

What is the bug?

When your document contains a field of type IEnumerable<int?> (or any other IEnumerable<Nullable<T>> apparently) it gets mapped incorrectly when auto-mapping. Instead of an integer type, an object type gets created, that contains the nullable properties.

When mapping a nullable object property like public int? Value { get; set; } the mapper correctly maps this field into an integer.

But when you map an array of nullable objects like public IEnumerable<int?> Values { get; set; } then it maps the nullable class members instead, like this:
image

What is the expected behavior?

A mapping for an integer gets created instead.

What is your host/environment?

Windows 11
OpenSearch.Client nuget version 1.5.0
OpenSearch Version: 2.9.0
OpenSearch Security Version: 2.9.0.0

@DumboJet DumboJet added bug Something isn't working untriaged labels Sep 29, 2023
@Xtansia Xtansia added good first issue Good for newcomers and removed untriaged labels Oct 3, 2023
DumboJetEngine pushed a commit to DumboJetEngine/opensearch-net that referenced this issue Jan 8, 2024
DumboJetEngine added a commit to DumboJetEngine/opensearch-net that referenced this issue Jan 8, 2024
DumboJetEngine added a commit to DumboJetEngine/opensearch-net that referenced this issue Jan 8, 2024
DumboJetEngine added a commit to DumboJetEngine/opensearch-net that referenced this issue Jan 8, 2024
DumboJetEngine added a commit to DumboJetEngine/opensearch-net that referenced this issue Jan 8, 2024
DumboJetEngine added a commit to DumboJetEngine/opensearch-net that referenced this issue Jan 8, 2024
DumboJetEngine added a commit to DumboJetEngine/opensearch-net that referenced this issue Jan 8, 2024
DumboJetEngine added a commit to DumboJetEngine/opensearch-net that referenced this issue Jan 10, 2024
DumboJetEngine added a commit to DumboJetEngine/opensearch-net that referenced this issue Jan 10, 2024
DumboJetEngine added a commit to DumboJetEngine/opensearch-net that referenced this issue Jan 10, 2024
DumboJetEngine added a commit to DumboJetEngine/opensearch-net that referenced this issue Jan 11, 2024
DumboJetEngine added a commit to DumboJetEngine/opensearch-net that referenced this issue Jan 12, 2024
Xtansia pushed a commit that referenced this issue Jan 12, 2024
Signed-off-by: Kostas <[email protected]>
(cherry picked from commit 14c8af6)

Signed-off-by: DumboJetEngine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants