Skip to content

chore: [ANDROSDK-2327] filter out category option mappings without filter#2642

Merged
taridepaco merged 2 commits into
developfrom
ANDROSDK-2327
Jun 25, 2026
Merged

chore: [ANDROSDK-2327] filter out category option mappings without filter#2642
taridepaco merged 2 commits into
developfrom
ANDROSDK-2327

Conversation

@taridepaco

@taridepaco taridepaco commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Category option mappings are expected to always carry a filter, but some objects arrive from the server without one. Since the field was non-nullable, deserialization failed on those objects. This makes CategoryOptionMappingDTO.filter nullable and drops the option mappings without a filter when mapping a category mapping to its domain model, so the program download no longer fails on these entries.

A program.json test case with an option mapping lacking a filter was added to verify it is excluded after deserialization and toDomain.

Related task: ANDROSDK-2327

Make CategoryOptionMappingDTO.filter nullable and drop option mappings
without a filter when mapping to domain, so deserialization no longer
fails on incoming objects that lack the (logically required) filter.
.categoryMapping(categoryMappingId)
.optionId(optionId)
.filter(filter)
.filter(filter!!)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This double !! is a bit scary, although the list is filtered out in the other class and shouldn't be a problem. Couldn't we return a null if filter is not defined, and then use the mapNotNull() in the other class? I mean, just to avoid the !!.

@sonarqubecloud

Copy link
Copy Markdown

@taridepaco taridepaco merged commit d02871b into develop Jun 25, 2026
11 checks passed
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.

2 participants