Repository navigation
fix: Set after attribute as string instead of integer - #3245
Conversation
in base json schemas
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
WalkthroughConverted the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 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)
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 |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
after attributes as string instead of integerafter attribute as string instead of integer
after attribute as string instead of integerafter attribute as string instead of integer
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
packages/core/cms/faststore/schema.json (1)
2707-2712:⚠️ Potential issue | 🟡 MinorDefault value type mismatch in ProductShelf:
0should be"0"The
afterfield now has"type": "string", but"default": 0is still an integer.Proposed fix
"after": { "type": "string", "title": "After", - "default": 0, + "default": "0", "description": "Initial pagination item" },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/core/cms/faststore/schema.json` around lines 2707 - 2712, The ProductShelf schema's "after" property declares "type": "string" but uses an integer default (default: 0); update the "after" property's default to a string ("0") so the default matches the declared type, i.e., change the default value for the "after" field to "0" in the schema.json.packages/core/cms/faststore/sections.json (1)
959-964:⚠️ Potential issue | 🟡 MinorDefault value type mismatch in ProductShelf section:
0should be"0"Update the default to a string for schema consistency.
Proposed fix
"after": { "type": "string", "title": "After", - "default": 0, + "default": "0", "description": "Initial pagination item" },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/core/cms/faststore/sections.json` around lines 959 - 964, The "after" property in the ProductShelf section schema is declared as type "string" but its default is the number 0; change the default value for the "after" field to the string "0" so the default matches the declared type (update the "after" property in sections.json for the ProductShelf schema to use "default": "0").packages/core/cms/faststore/components/cms_component__productshelf.jsonc (1)
26-31:⚠️ Potential issue | 🟡 MinorDefault value type mismatch:
0should be"0"The
typeis now"string", but"default": 0remains an integer. For JSON Schema consistency, update the default to a string value.Proposed fix
"after": { "type": "string", "title": "After", - "default": 0, + "default": "0", "description": "Initial pagination item" },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/core/cms/faststore/components/cms_component__productshelf.jsonc` around lines 26 - 31, The "after" schema property currently declares "type": "string" but uses an integer default (default: 0); change the default for the "after" property in cms_component__productshelf.jsonc to a string value ("0") so the default matches the declared type and JSON Schema validation succeeds, updating the "after" property's "default" from 0 to "0".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/core/cms/faststore/components/cms_component__producttiles.jsonc`:
- Around line 20-25: The "after" property in cms_component__producttiles.jsonc
declares "type": "string" but uses a numeric default (default: 0); update the
default for the "after" field to be a string ("0") so it matches the declared
type—locate the "after" property (title: "After") and change its "default" value
from 0 to "0".
In `@packages/core/cms/faststore/schema.json`:
- Around line 2818-2823: The "after" property in the ProductTiles schema
currently uses a numeric default (0) while its type is "string"; change the
default to the string "0" so the default value matches the declared type and
maintains consistency with other pagination fields—update the "after" property's
"default" from 0 to "0" in the schema (property name: "after").
In `@packages/core/cms/faststore/sections.json`:
- Around line 1122-1127: The "after" field in the ProductTiles section has a
default value of 0 which conflicts with its "type": "string"; update the "after"
property's default to the string "0" (i.e., change default from 0 to "0") so it
matches the declared type; locate the "after" property in the ProductTiles
section of sections.json to make this edit.
---
Outside diff comments:
In `@packages/core/cms/faststore/components/cms_component__productshelf.jsonc`:
- Around line 26-31: The "after" schema property currently declares "type":
"string" but uses an integer default (default: 0); change the default for the
"after" property in cms_component__productshelf.jsonc to a string value ("0") so
the default matches the declared type and JSON Schema validation succeeds,
updating the "after" property's "default" from 0 to "0".
In `@packages/core/cms/faststore/schema.json`:
- Around line 2707-2712: The ProductShelf schema's "after" property declares
"type": "string" but uses an integer default (default: 0); update the "after"
property's default to a string ("0") so the default matches the declared type,
i.e., change the default value for the "after" field to "0" in the schema.json.
In `@packages/core/cms/faststore/sections.json`:
- Around line 959-964: The "after" property in the ProductShelf section schema
is declared as type "string" but its default is the number 0; change the default
value for the "after" field to the string "0" so the default matches the
declared type (update the "after" property in sections.json for the ProductShelf
schema to use "default": "0").
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: da1b545d-63d5-42d7-a662-a4f9e777e597
📒 Files selected for processing (4)
packages/core/cms/faststore/components/cms_component__productshelf.jsoncpackages/core/cms/faststore/components/cms_component__producttiles.jsoncpackages/core/cms/faststore/schema.jsonpackages/core/cms/faststore/sections.json
## What's the purpose of this pull request? This applies the same hotfix as [PR #3245](#3245): align the `after` pagination cursor with string type (and related CMS schema updates) so hCMS → Content Platform migrations do not hit type mismatches. ## References - #3245 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Normalized pagination handling for ProductShelf and ProductTiles so "after" cursors are processed consistently across the storefront. * **Chores** * Updated CMS configuration schemas and added foundational schema definitions to improve content and template handling. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
What's the purpose of this pull request?
This PR changes the way base json schemas treat the
afterattribute to ensure stores migrating from hCMS to the new CMS (Content Platform) don't have type mismatch.This should be treated as a hotfix given the urgency: we need to ensure that store migrations (which will begin early next week) occur without type errors. We should release a new stable version (merge in
main) containing this fix and make this version the minimum required for the migration to take place.How it works?
From now on the
afterattribute will be sent to the hCMS and CMS asstring, not asinteger, matching the type is sent to VTEX APIs (GraphQL queries from@faststore/api).Starters Deploy Preview
References
Field validation error on CMS (Content Platform):
Summary by CodeRabbit