Altinn / Altinn/app-lib-dotnet

"nil=true" in XML disapears for elements of type xs:date

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

Description

### Description of the bug

For schemas having elements of type xs:date and nillable = true, the XML which is stored in an instance loses the xsi:nil=true attribute at some point.

Related to xs:date, it is represented in C# as a string having a regex. Couldn't it be represented as DateOnly instead?

### Steps To Reproduce

Define element in XSD:
``

Create instance with nil input for the datefield
XML input
``

Retreive the dataelement, the ouput will be like this
``

### Additional Information

- Related: https://github.com/Altinn/app-frontend-react/issues/2580

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the XSD case with an xs:date, nillable=true element and the provided xsi:nil="true" input, then trace where the stored XML is read or serialized. Confirm the expected output preserves xsi:nil="true"; the DateOnly suggestion is a separate consideration rather than a defined completion requirement.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.