Skip to content

fix: Set after attribute as string instead of integer - #3245

Merged
lucasfp13 merged 4 commits into
mainfrom
fix/field-after-as-string
Mar 27, 2026
Merged

lucasfp13 merged 4 commits into
mainfrom
fix/field-after-as-string

Conversation

@lucasfp13

@lucasfp13 lucasfp13 commented Mar 25, 2026 •

Copy link
Copy Markdown
Contributor

What's the purpose of this pull request?

This PR changes the way base json schemas treat the after attribute 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 after attribute will be sent to the hCMS and CMS as string, not as integer, matching the type is sent to VTEX APIs (GraphQL queries from @faststore/api).

Starters Deploy Preview

References

Field validation error on CMS (Content Platform):

Screenshot 2026-03-25 at 16 53 25

Summary by CodeRabbit

  • Bug Fixes
    • Pagination cursor for product shelf and product tiles now accepts string values and uses "0" as the normalized default. This improves pagination consistency across the storefront, reduces type-related errors when configuring or navigating paginated product lists, and ensures more predictable behavior for loading additional product pages.

@lucasfp13 lucasfp13 self-assigned this Mar 25, 2026
@coderabbitai

coderabbitai Bot commented Mar 25, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cc8434f6-d8da-471f-9869-952d45e2b3c6

📥 Commits

Reviewing files that changed from the base of the PR and between fcbd6b5 and d6fc581.

📒 Files selected for processing (2)
  • packages/core/cms/faststore/base.jsonc
  • packages/core/cms/faststore/schema.json
✅ Files skipped from review due to trivial changes (1)
  • packages/core/cms/faststore/base.jsonc

Walkthrough

Converted the after pagination cursor from integer (default 0) to string (default "0") across FastStore CMS schemas; removed the top-level $id from packages/core/cms/faststore/schema.json and changed the $id in packages/core/cms/faststore/base.jsonc to vtex.faststore.

Changes

Cohort / File(s) Summary
Component definitions
packages/core/cms/faststore/components/cms_component__productshelf.jsonc, packages/core/cms/faststore/components/cms_component__producttiles.jsonc
Changed after property: type integer → string, default 0 → "0".
Schema file
packages/core/cms/faststore/schema.json
Removed top-level "$id"; changed after in ProductShelf and ProductTiles: type integer → string, default 0 → "0".
Section definitions
packages/core/cms/faststore/sections.json
Changed after property for ProductShelf and ProductTiles: type integer → string, default 0 → "0".
Base schema metadata
packages/core/cms/faststore/base.jsonc
Updated JSON Schema $id value from full URL → "vtex.faststore" and reordered comments/sections; no functional schema field changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A zero sheds its digits, wraps in quotes,
Cursor hums in gentler notes,
IDs trimmed and labels neat,
Schemas whisper, small and sweet,
FastStore tweaks — tidy beats. 🛠️

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: converting the after attribute from integer to string type across multiple schema files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/field-after-as-string

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.

@codesandbox-ci

codesandbox-ci Bot commented Mar 25, 2026 •

Copy link
Copy Markdown

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.

@lucasfp13 lucasfp13 changed the title fix: Set after attributes as string instead of integer fix: Set after attribute as string instead of integer Mar 25, 2026
@lucasfp13 lucasfp13 changed the title fix: Set after attribute as string instead of integer fix: Set after attribute as string instead of integer Mar 25, 2026
@lucasfp13
lucasfp13 changed the base branch from dev to main March 25, 2026 19:48
@lucasfp13 lucasfp13 added the hotfix Address critical bugs that need to be fixed immediately label Mar 25, 2026
@lucasfp13
lucasfp13 marked this pull request as ready for review March 25, 2026 19:54
@lucasfp13
lucasfp13 requested a review from a team as a code owner March 25, 2026 19:54
@lucasfp13
lucasfp13 requested review from eduardoformiga and renatamottam and removed request for a team March 25, 2026 19:54

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 | 🟡 Minor

Default value type mismatch in ProductShelf: 0 should be "0"

The after field now has "type": "string", but "default": 0 is 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 | 🟡 Minor

Default value type mismatch in ProductShelf section: 0 should 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 | 🟡 Minor

Default value type mismatch: 0 should be "0"

The type is now "string", but "default": 0 remains 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

📥 Commits

Reviewing files that changed from the base of the PR and between 7a52516 and cb3b2f6.

📒 Files selected for processing (4)
  • packages/core/cms/faststore/components/cms_component__productshelf.jsonc
  • packages/core/cms/faststore/components/cms_component__producttiles.jsonc
  • packages/core/cms/faststore/schema.json
  • packages/core/cms/faststore/sections.json

Comment thread packages/core/cms/faststore/schema.json Resolved
@lucasfp13
lucasfp13 requested review from hellofanny, lariciamota, lemagnetic, matheusps and ommeirelles and removed request for renatamottam March 25, 2026 20:10
@lucasfp13
lucasfp13 merged commit c40d3fc into main Mar 27, 2026
6 checks passed
@lucasfp13
lucasfp13 deleted the fix/field-after-as-string branch March 27, 2026 17:58
@coderabbitai coderabbitai Bot mentioned this pull request Mar 27, 2026
5 tasks
lemagnetic added a commit that referenced this pull request Mar 27, 2026
## 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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotfix Address critical bugs that need to be fixed immediately

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants