Skip to content

chore(schemas): sync with release700 blob artifacts#1239

Open
divyagovindaiah wants to merge 2 commits into
Sunbird-Knowlg:masterfrom
divyagovindaiah:sync/schemas-release700
Open

chore(schemas): sync with release700 blob artifacts#1239
divyagovindaiah wants to merge 2 commits into
Sunbird-Knowlg:masterfrom
divyagovindaiah:sync/schemas-release700

Conversation

@divyagovindaiah
Copy link
Copy Markdown

@divyagovindaiah divyagovindaiah commented May 27, 2026

  • add movie schema (new object type)
  • update category, categoryinstance, collection, dialcode, objectcategory, question, questionset schemas

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Type of change

Please choose appropriate options.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes in the below checkboxes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Ran Test A
  • Ran Test B

Test Configuration:

  • Software versions: Java 11, scala-2.12, play-2.7.2
  • Hardware versions: 2 CPU/ 4GB RAM

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Summary by CodeRabbit

Release Notes

  • New Features

    • Added support for Movie objects, including complete schema definitions and validation rules.
  • Schema Updates

    • Restructured CategoryInstance data format for improved data handling.
    • Updated validation constraints and schema properties across Question, QuestionSet, and related schemas.
    • Refined ObjectCategory schema by streamlining field definitions.

Review Change Stack

- add movie schema (new object type)
- update category, categoryinstance, collection, dialcode,
  objectcategory, question, questionset schemas
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 27, 2026

Caution

Review failed

An error occurred during the review process. Please try again later.

📝 Walkthrough

Walkthrough

This PR extends the schema registry with a new Movie schema and refines validation, data shapes, and metadata handling across existing schemas. Key updates include introducing Movie definition with versioning and external table mappings, reshaping CategoryInstance field structures, adjusting Question/QuestionSet validation controls and removing properties, cleaning up ObjectCategory metadata fields, and formatting consistency improvements.

Changes

Schema Definitions and Validation Updates

Layer / File(s) Summary
Movie schema definition
schemas/movie/1.0/config.json, schemas/movie/1.0/schema.json
Introduces complete Movie schema with config defining object type, boxSet relation, create/update property restrictions, versioning enabled with versionCheckMode: "ON", and external movie_data table mapping with typed fields; schema specifies required properties (name, year, director, genres, description), enums for maturityRating and status (default: unreleased), and forbids additional properties.
CategoryInstance data shape evolution
schemas/categoryinstance/1.0/schema.json
Reshapes translations and defaultTerm properties from object-based to array-based string structures; changes index property type from number to string, altering downstream validation behavior.
Question schema and config refinement
schemas/question/1.1/config.json, schemas/question/1.1/schema.json
Updates Question configuration to set schema_restrict_api: false (from true), reformats arrays and nested objects into multiline structures for readability, and removes inline description text from the code property while preserving its string type constraint; reformats media, responseDeclaration, and mapping definitions without changing enum values or validation logic.
QuestionSet validation and additionalProperties updates
schemas/questionset/1.1/config.json, schemas/questionset/1.1/schema.json
Changes versionCheckMode from "ON" to "OFF", sets schema_restrict_api: false (from true), removes root-level additionalProperties: false constraint from schema, and reformats PII fields and configuration structures into multiline form without altering field values.
ObjectCategory property cleanup
schemas/objectcategory/1.0/schema.json
Removes metadata tracking properties (createdOn, lastUpdatedOn, lastStatusChangedOn, versionKey) from the schema's root properties while retaining visibility and additionalProperties: false constraints.
Category and minor structure fixes
schemas/category/1.0/schema.json, schemas/collection/1.0/config.json, schemas/dialcode/1.0/config.json, schemas/dialcode/1.0/schema.json
Adjusts indentation and formatting across Category schema without changing structure or validation logic; modifies structural boundaries in Collection and Dialcode files at closing braces and PII field separators.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Schemas hop and bound, so neat and clean,
New Movie joins the platform scene,
Arrays reshape, timestamps vanish bright,
Validations adjusted—all feels right! 🎬

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description includes a high-level summary of changes (new movie schema and updates to existing schemas) but lacks critical details: no issue reference, motivation, context, testing execution confirmation, or completed checklist items despite template requirements. Add issue reference, motivation/context for schema changes, confirm which tests were run, specify test results, and complete the checklist items to clarify the change's scope and testing status.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: synchronizing schemas with release700 blob artifacts, which aligns with the PR's core objective of updating multiple schema files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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
Copy Markdown
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: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
schemas/objectcategory/1.0/schema.json (1)

9-41: ⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Potential breaking contract: ObjectCategory schema will now reject legacy metadata fields

schemas/objectcategory/1.0/schema.json has additionalProperties: false and no longer defines createdOn, lastUpdatedOn, lastStatusChangedOn, or versionKey, so any request still sending those keys will fail validation. The create/update path validates the incoming payload’s metadata against the JSON schema via DefinitionNode.validateSchemaValidator.validate(node.getMetadata) (backed by platform-core/schema-validator), and it does not strip unknown properties.

Ensure all producers are updated (or server-side strips/compat is added), and add/extend tests to cover requests containing those legacy fields.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@schemas/objectcategory/1.0/schema.json` around lines 9 - 41, The schema in
schemas/objectcategory/1.0/schema.json currently sets additionalProperties:
false and omits legacy metadata fields (createdOn, lastUpdatedOn,
lastStatusChangedOn, versionKey), which will break Validation via
DefinitionNode.validate → SchemaValidator.validate when passing
node.getMetadata; fix by adding those legacy fields back into the "properties"
block (define types for createdOn, lastUpdatedOn, lastStatusChangedOn,
versionKey) or, if intended, switch additionalProperties to true to accept
unknown metadata, and update/extend tests for create/update flows to include
payloads with those legacy keys so
DefinitionNode.validate/SchemaValidator.validate behavior is covered; ensure
whichever approach you choose is applied consistently across producers or add
server-side stripping/compatibility prior to calling SchemaValidator.validate.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@schemas/categoryinstance/1.0/schema.json`:
- Around line 65-67: The schema changed the "index" field to type "string",
which is inconsistent with downstream code (CategoryInstanceActor, TermActor
produce Integer/Number and NodeUtil expects asInstanceOf[Integer]); restore type
safety by changing "index" back to a numeric type (use "type": "integer" if you
only allow integers or "number" for floats) in schema.json and ensure any JSON
validators reflect that, or if strings are intentional update the producers and
consumers instead: modify CategoryInstanceActor and TermActor to emit string
values for "index" and update NodeUtil to read it as String then safely parse to
Int (with validation/fallback) and adjust any ordering logic to use numeric
comparison; run/adjust tests covering index serialization/deserialization and
ordering to prevent regressions.

In `@schemas/movie/1.0/schema.json`:
- Around line 13-99: The schema in schemas/movie/1.0/schema.json currently sets
"additionalProperties": false and does not include the external-mapped fields
summaries, synopsis, awards, and story in the "properties" object, causing
validation to reject those mapped fields; update the "properties" section to add
string (or appropriate type) entries for "summaries", "synopsis", "awards", and
"story" (or set their types/arrays to match what config.json expects) or allow
them via "additionalProperties": true if intended, ensuring the schema and the
external.properties mapping align (refer to the "properties" object and the
"additionalProperties" flag to implement the fix).

In `@schemas/question/1.1/config.json`:
- Line 76: The config currently disables API-level shape rejection by setting
"schema_restrict_api": false; restore strict request validation by setting
"schema_restrict_api": true in schemas/question/1.1/config.json or, if you
intentionally need API flexibility, add equivalent validator-side enforcement in
the schema-validator (platform-core/schema-validator) and update the Question
schema.json to disallow additional properties at the root (so
DefinitionDTO.validateRequest behavior is preserved); ensure tests cover
rejection of unknown request fields so DefinitionDTO.validateRequest semantics
remain enforced.

In `@schemas/questionset/1.1/config.json`:
- Line 24: Re-enable the QuestionSet write-safety and request-guardrails by
changing the config values in schemas/questionset/1.1/config.json: set
"versionCheckMode" back to a mode that enforces VersionKeyValidator (not "OFF")
so the VersionKeyValidator concurrency check runs, and set "schema_restrict_api"
to true (or add equivalent logic) so DefinitionDTO.validateRequest's
allowlist/invalid-prop checks run for incoming requests; if you prefer
service-level enforcement, implement equivalent validation in the
request/validator layer (the VersionKeyValidator and
DefinitionDTO.validateRequest code paths) and add regression tests covering
update concurrency and unknown-top-level-field rejection, and ensure schema
validation uses platform-core/schema-validator with schemas loaded from the repo
by configuring schema.base_path to the local schemas/ directory rather than the
remote blob path.

In `@schemas/questionset/1.1/schema.json`:
- Around line 714-715: The root JSON Schema's top-level object is missing
additionalProperties, making the schema permissive; reinstate
additionalProperties: false on the root schema object (the top-level JSON object
definition in this file) so undeclared fields are rejected, and ensure this
change doesn't conflict with any intended extensibility or existing $ref'd
subschemas—if extensibility is required, document and explicitly allow specific
properties instead of leaving additionalProperties undefined.

---

Outside diff comments:
In `@schemas/objectcategory/1.0/schema.json`:
- Around line 9-41: The schema in schemas/objectcategory/1.0/schema.json
currently sets additionalProperties: false and omits legacy metadata fields
(createdOn, lastUpdatedOn, lastStatusChangedOn, versionKey), which will break
Validation via DefinitionNode.validate → SchemaValidator.validate when passing
node.getMetadata; fix by adding those legacy fields back into the "properties"
block (define types for createdOn, lastUpdatedOn, lastStatusChangedOn,
versionKey) or, if intended, switch additionalProperties to true to accept
unknown metadata, and update/extend tests for create/update flows to include
payloads with those legacy keys so
DefinitionNode.validate/SchemaValidator.validate behavior is covered; ensure
whichever approach you choose is applied consistently across producers or add
server-side stripping/compatibility prior to calling SchemaValidator.validate.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 042ca4e9-d137-40fb-879f-f04ba066da73

📥 Commits

Reviewing files that changed from the base of the PR and between ed1aa98 and b01db78.

📒 Files selected for processing (12)
  • schemas/category/1.0/schema.json
  • schemas/categoryinstance/1.0/schema.json
  • schemas/collection/1.0/config.json
  • schemas/dialcode/1.0/config.json
  • schemas/dialcode/1.0/schema.json
  • schemas/movie/1.0/config.json
  • schemas/movie/1.0/schema.json
  • schemas/objectcategory/1.0/schema.json
  • schemas/question/1.1/config.json
  • schemas/question/1.1/schema.json
  • schemas/questionset/1.1/config.json
  • schemas/questionset/1.1/schema.json
💤 Files with no reviewable changes (1)
  • schemas/collection/1.0/config.json

Comment thread schemas/categoryinstance/1.0/schema.json
Comment thread schemas/movie/1.0/schema.json Outdated
Comment thread schemas/question/1.1/config.json
Comment thread schemas/questionset/1.1/config.json
Comment thread schemas/questionset/1.1/schema.json
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.

1 participant