Skip to content

chore: update applicationmetadata schema with resourceregistry fields#4060

Open
Jondyr wants to merge 1 commit intomainfrom
chore/update-applicationmetadata-schemas-resource-registry-fields
Open

chore: update applicationmetadata schema with resourceregistry fields#4060
Jondyr wants to merge 1 commit intomainfrom
chore/update-applicationmetadata-schemas-resource-registry-fields

Conversation

@Jondyr
Copy link
Member

@Jondyr Jondyr commented Mar 16, 2026

Description

Fields added are used when publishing resources to Resource Registry

Related Issue(s)

Verification/QA

  • Manual functionality testing
    • I have tested these changes manually
    • Creator of the original issue (or service owner) has been contacted for manual testing (or will be contacted when released in alpha)
    • No testing done/necessary
  • Automated tests
    • Unit test(s) have been added/updated
    • Cypress E2E test(s) have been added/updated
    • No automatic tests are needed here (no functional changes/additions)
    • I want someone to help me make some tests
  • UU/WCAG (follow these guidelines until we have our own)
    • I have tested with a screen reader/keyboard navigation/automated wcag validator
    • No testing done/necessary (no DOM/visual changes)
    • I want someone to help me perform accessibility testing
  • User documentation @ altinn-studio-docs
    • Has been added/updated
    • No functionality has been changed/added, so no documentation is needed
    • I will do that later/have created an issue
  • Support in Altinn Studio
    • Issue(s) created for support in Studio
    • This change/feature does not require any changes to Altinn Studio
  • Sprint board
    • The original issue (or this PR itself) has been added to the Team Apps project and to the current sprint board
    • I don't have permissions to do that, please help me out
  • Labels
    • I have added a kind/* and backport* label to this PR for proper release notes grouping
    • I don't have permissions to add labels, please help me out

Summary by CodeRabbit

  • New Features
    • Extended application metadata with access control definitions, delegable permissions, and visibility settings
    • Added contact points management with email, telephone, and contact page information
    • Introduced keyword tagging system with language-specific support
    • Enabled multi-language translations for descriptions, homepage, and metadata fields

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 16, 2026

📝 Walkthrough

Walkthrough

This pull request introduces new schema elements to the application metadata JSON schema and modifies the Calculator class in Python. Changes include adding root properties and definitions for access, contact points, and keywords; implementing a new addition method; and updating an existing method signature alongside a variable rename.

Changes

Cohort / File(s) Summary
Application Metadata Schema
schemas/json/application/application-metadata.schema.v1.json
Introduces new root properties (access, contactPoints, description, keywords, homepage) and definitions (keyword, access, contactPoints, translatedText). Keyword is structured as an object with word and language properties. Access includes rightDescription, visible, and delegable fields. ContactPoints defined as an array with category, email, telephone, and contactPage properties. TranslatedText supports nb, en, nn translations with arbitrary additional properties.
Calculator Module
src/calculator.py
Adds new coderabbit_add(x, y) method to Calculator class. Updates coderabbit_formula(x, y) signature to include z parameter. Renames global variable from old_global_var to new_global_var.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: updating the applicationmetadata schema with resourceregistry fields.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description covers the main sections of the template including verification/QA checklist items and properly indicates that no related issues exist.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/update-applicationmetadata-schemas-resource-registry-fields
📝 Coding Plan
  • Generate coding plan for human review comments

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.

@Jondyr Jondyr added kind/other Pull requests containing chores/repo structure/other changes backport-ignore This PR is a new feature and should not be cherry-picked onto release branches labels Mar 16, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
schemas/json/application/application-metadata.schema.v1.json (2)

162-212: Harden new object definitions to avoid accepting unknown keys

Line 162, Line 173, and Line 192 introduce object shapes without additionalProperties: false, so typos/extra fields will silently validate.

Proposed schema tightening
     "keyword": {
       "type": "object",
+      "additionalProperties": false,
+      "required": ["word", "language"],
       "properties": {
         "word": {
           "type": "string"
         },
         "language": {
           "type": "string"
         }
       }
     },
     "access": {
       "type": "object",
+      "additionalProperties": false,
       "properties": {
         "rightDescription": {
           "$ref": "#/definitions/translatedText"
         },
@@
     "contactPoints": {
       "type": "array",
       "items": {
         "type": "object",
+        "additionalProperties": false,
         "properties": {
           "category": {
             "type": "string",
             "title": "Category"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@schemas/json/application/application-metadata.schema.v1.json` around lines
162 - 212, The new object schemas "keyword", "access", and the items object
inside "contactPoints" currently allow unknown keys; update each of these object
definitions by adding "additionalProperties": false to the "keyword" object, the
"access" object, and the object under "contactPoints" -> "items" so that stray
or misspelled fields are rejected; locate the "keyword", "access", and
"contactPoints" symbols in the schema and add the additionalProperties:false
constraint to those object definitions (ensure you do not remove existing
properties or $ref usage).

156-159: Add format validation for URL/email fields

Line 156 (homepage) and Line 198/206 (email, contactPage) are plain strings. Adding schema format improves data quality before publish.

Proposed format constraints
     "homepage": {
       "type": "string",
-      "title": "Homepage"
+      "title": "Homepage",
+      "format": "uri"
     }
@@
           "email": {
             "type": "string",
-            "title": "Email"
+            "title": "Email",
+            "format": "email"
           },
@@
           "contactPage": {
             "type": "string",
-            "title": "Contact page"
+            "title": "Contact page",
+            "format": "uri"
           }

Also applies to: 198-208

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@schemas/json/application/application-metadata.schema.v1.json` around lines
156 - 159, The JSON Schema currently defines "homepage", "email", and
"contactPage" as plain strings; update these properties in
application-metadata.schema.v1.json to include the appropriate "format"
constraints (e.g., add "format": "uri" for homepage and contactPage and
"format": "email" for email) so the schema validates URLs/emails correctly;
adjust any corresponding "type" assertions if needed and ensure existing
examples/tests still conform to the new formats.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@schemas/json/application/application-metadata.schema.v1.json`:
- Around line 138-159: Update the TypeScript types IncomingApplicationMetadata
and ApplicationMetadata to include the new optional properties present in the
JSON schema: add optional fields access, contactPoints, description, keywords,
and homepage to both interfaces (use appropriate types: access -> the existing
Access type or a matching shape, contactPoints -> ContactPoint[] or its existing
type, description -> TranslatedText, keywords -> string[] or Keyword[], and
homepage -> string), ensuring they are marked optional so existing code remains
compatible; modify the type declarations where IncomingApplicationMetadata and
ApplicationMetadata are defined to include these property names with the correct
referenced types.

---

Nitpick comments:
In `@schemas/json/application/application-metadata.schema.v1.json`:
- Around line 162-212: The new object schemas "keyword", "access", and the items
object inside "contactPoints" currently allow unknown keys; update each of these
object definitions by adding "additionalProperties": false to the "keyword"
object, the "access" object, and the object under "contactPoints" -> "items" so
that stray or misspelled fields are rejected; locate the "keyword", "access",
and "contactPoints" symbols in the schema and add the additionalProperties:false
constraint to those object definitions (ensure you do not remove existing
properties or $ref usage).
- Around line 156-159: The JSON Schema currently defines "homepage", "email",
and "contactPage" as plain strings; update these properties in
application-metadata.schema.v1.json to include the appropriate "format"
constraints (e.g., add "format": "uri" for homepage and contactPage and
"format": "email" for email) so the schema validates URLs/emails correctly;
adjust any corresponding "type" assertions if needed and ensure existing
examples/tests still conform to the new formats.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f88043d6-ff47-4c69-9ac5-06212c985a10

📥 Commits

Reviewing files that changed from the base of the PR and between e899e6d and 4d69ff3.

📒 Files selected for processing (1)
  • schemas/json/application/application-metadata.schema.v1.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-ignore This PR is a new feature and should not be cherry-picked onto release branches kind/other Pull requests containing chores/repo structure/other changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant