chore: update applicationmetadata schema with resourceregistry fields#4060
chore: update applicationmetadata schema with resourceregistry fields#4060
Conversation
📝 WalkthroughWalkthroughThis 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
There was a problem hiding this comment.
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 keysLine 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 fieldsLine 156 (
homepage) and Line 198/206 (contactPage) are plain strings. Adding schemaformatimproves 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
📒 Files selected for processing (1)
schemas/json/application/application-metadata.schema.v1.json
Description
Fields added are used when publishing resources to Resource Registry
Related Issue(s)
Verification/QA
kind/*andbackport*label to this PR for proper release notes groupingSummary by CodeRabbit