Skip to content

fix: copy models/*.xsd to publish output so XSD validation runs in deployed apps - #1854

Merged
ivarne merged 3 commits into
Altinn:mainfrom
ivarne-agent:fix/xsd-validation-publish-output
Sep 17, 2026
Merged

ivarne merged 3 commits into
Altinn:mainfrom
ivarne-agent:fix/xsd-validation-publish-output

Conversation

@ivarne-agent

Copy link
Copy Markdown
Contributor

The Web SDK only copies *.json and *.config files to the build and publish output, so the XSD schemas in models/ never reached the Docker image. With AppSettings:XsdValidation enabled, XsdValidator was registered but IAppResources.GetXsdSchema returned null for every data type and the validator silently skipped them. It only worked when the app ran from its source folder (dotnet run, studioctl).

Ship a build/Altinn.App.Api.targets file in the Altinn.App.Api package with a Content rule for models/**/*.xsd so every app picks it up on package upgrade, and log a missing schema as a warning instead of an informational message. The targets file follows the props file through the experimental rename for PR builds.

Verification

  • Your code builds clean without any errors or warnings
  • 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)

…ployed apps

The Web SDK only copies *.json and *.config files to the build and publish
output, so the XSD schemas in models/ never reached the Docker image. With
AppSettings:XsdValidation enabled, XsdValidator was registered but
IAppResources.GetXsdSchema returned null for every data type and the
validator silently skipped them. It only worked when the app ran from its
source folder (dotnet run, studioctl).

Ship a build/Altinn.App.Api.targets file in the Altinn.App.Api package with
a Content rule for models/**/*.xsd so every app picks it up on package
upgrade, and log a missing schema as a warning instead of an informational
message. The targets file follows the props file through the experimental
rename for PR builds.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: e1555aee-36bf-4cbc-b7bb-ccde4c5c2450


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.

@ivarne

ivarne commented Sep 16, 2026

Copy link
Copy Markdown
Member

/publish

@github-actions

github-actions Bot commented Sep 16, 2026

Copy link
Copy Markdown

@ivarne ivarne added the bugfix Label Pull requests with bugfix. Used when generation releasenotes label Sep 16, 2026
@github-actions

github-actions Bot commented Sep 17, 2026

Copy link
Copy Markdown

@ivarne

ivarne commented Sep 17, 2026

Copy link
Copy Markdown
Member

/publish

@github-actions

github-actions Bot commented Sep 17, 2026

Copy link
Copy Markdown

1 similar comment
@github-actions

github-actions Bot commented Sep 17, 2026

Copy link
Copy Markdown

@ivarne
ivarne merged commit a099b47 into Altinn:main Sep 17, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Label Pull requests with bugfix. Used when generation releasenotes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants