Altinn / Altinn/app-lib-dotnet

Possible to upload a formdata that does not match the datamodel

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

Description

## Describe the bug
Possible to upload a formdata that does not match the datamodel from the API.

## To Reproduce
Steps to reproduce the behavior:
1. POST instance to create an app instance with formdata
2. Send a PUT request to edit the formdata of the instance with an XML body that does not match with the datamodel of the app.
[https://{{org}}.apps.{{envUrl}}/{{org}}/{{app}}/instances/{{instanceOwnerId}}/{{instanceId}}/data/{{dataGuid}}](url)
3. The response code is 201 created.

## Expected behavior
400 Bad request with a valid error message.

## Additional info
App: ttd/apps-test
Env: At22

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the PUT request to the instance data endpoint with XML that does not match the app datamodel, using the ttd/apps-test app in the At22 environment. Trace where the request is accepted and identify what validation result produces the 201 response; done means invalid formdata returns 400 with a valid error message.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api
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.