Altinn / Altinn/app-lib-dotnet

PostSimplified prefill does not support lists

Open
#178 1 comment 3 reactions 0 assignees View on GitHub
kind/bug
Dominant language
C#
Stars
8
Forks
27
Avg merge
1h 21m
Merged PRs (30d)
7

Description

### Description of the bug

When instantiating with prefill, the prefill ignores lists.

![image](https://user-images.githubusercontent.com/554713/215986896-389791f8-5f17-41fd-8cb8-d036b0830fbd.png)

Looking into the code, it looks like the prefill have no list support implemented?
https://github.com/Altinn/app-lib-dotnet/blob/1be1b79ce004aaa27a8cd12fcfdba2bf6e839442/src/Altinn.App.Core/Implementation/PrefillSI.cs#L161

If this get fixed, it would be nice to also implement support for nested objects, instead of the current flat structure.

### Steps To Reproduce

Call PostSimplified (https://{org}.apps.altinn.no/{org}/{app}/instances/create) with prefill that contains a list that should be deserialized into a corresponding List class.

### Additional Information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the PrefillSI.cs code around line 161 and reproduce the issue through the PostSimplified instances/create endpoint using prefill containing a list. Trace how the prefill is deserialized, then verify that list values are populated in the corresponding model and consider the requested nested-object support; done means these cases are covered and tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.