Skip to content

Feat/methods to access xsd#1668

Open
MagnusNordboe wants to merge 3 commits intoAltinn:feat/methods-to-access-xsdfrom
MagnusNordboe:feat/methods-to-access-xsd
Open

Feat/methods to access xsd#1668
MagnusNordboe wants to merge 3 commits intoAltinn:feat/methods-to-access-xsdfrom
MagnusNordboe:feat/methods-to-access-xsd

Conversation

@MagnusNordboe
Copy link

Uses the new methods to access XSD to add opt-in validation based on XSD rules, if user has a schema with the same name as the data model.

Description

  • Added a new class XsdValidator:IValidator
  • Added default description of error in TranslationService.cs
  • Added a new setting in appsettings XsdValidation

Verification

  • [x ] Your code builds clean without any errors or warnings
  • [x ] Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)
  • All tests run green

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)
image

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 23, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Member

@ivarne ivarne left a comment

Choose a reason for hiding this comment

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

Ser bra ut. Har noen små kommentarer. I tillegg må vi nok ha noen unit tester så vi ikke brekker funksjonaliteten når vi gjør endringer.

continue;
}
var formData = await dataAccessor.GetFormData(dataElement);
ObjectUtils.RemoveAltinnRowId(formData);
Copy link
Member

Choose a reason for hiding this comment

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

Bør vi fjerne altinnRowId her, eller bare kreve at den legges til som optional i xsd? Det er nok flere forskjeller, men dette er jo det eneste eksemplet (jeg har sett det har blitt klaget på) der xsd validering og data annotations gir ulikt resultat, men kanskje dere har andre grunner for å gjøre dette?


if (appSettings?.XsdValidation is true)
{
services.AddTransient<IValidator, XsdValidator>();
Copy link
Member

Choose a reason for hiding this comment

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

Bør det være standard å ha både DataAnnotationValidator og XsdValidator, eller bør aktivering av XsdValidation være et alternativ til dataAnnotations?

@MagnusNordboe MagnusNordboe requested a review from ivarne February 27, 2026 13:33
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