Skip to content

fix(api): correct item videos field casing - #3447

Merged
hellofanny merged 3 commits into
vtex:devfrom
evander-corebiz:fix/api-correct-item-videos-field
Aug 25, 2026
Merged

hellofanny merged 3 commits into
vtex:devfrom
evander-corebiz:fix/api-correct-item-videos-field

Conversation

@evander-corebiz

@evander-corebiz evander-corebiz commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

What's the purpose of this pull request?

The Item type in the VTEX Search API client declares the video field as Videos, but the FastStore GraphQL search response returns it as videos.

This mismatch makes the internal TypeScript type inconsistent with the actual payload and may cause incorrect property access for SKU videos.

This PR updates the field casing while preserving its existing string[] type.

How it works?

The Item interface now declares the field as:

videos: string[]

No runtime behavior or public GraphQL schema was changed.

How to test it?

  • Confirm that ProductSearchResult.Item exposes videos as string[].
  • Run the Biome validation:
pnpm exec biome check packages/api/src/platforms/vtex/clients/search/types/ProductSearchResult.ts
  • Validate the diff:
git diff --check

Both checks should pass.

Starters Deploy Preview

Not applicable. This is a type-only change with no storefront UI or runtime behavior changes.

References

Checklist

You may erase this after checking them all 😉

PR Title and Commit Messages

PR Description

  • Added a label according to the PR goal - breaking change, bug, contributing, performance, documentation..

    • Label used: bug

Dependencies

  • Committed the pnpm-lock.yaml file when there were changes to the packages

    • No dependencies or package versions were changed, so pnpm-lock.yaml was not modified.

Documentation

  • PR description

  • For documentation changes, ping @Mariana-Caetano to review and update (Or submit a doc request)

    • Not applicable. This PR only corrects an internal TypeScript type.

Summary by CodeRabbit

Summary by CodeRabbit

  • Bug Fixes
    • Improved compatibility for product video data in search results by retaining support for the deprecated Videos property alongside videos.

@evander-corebiz
evander-corebiz requested a review from a team as a code owner August 12, 2026 13:47
@evander-corebiz
evander-corebiz requested review from gabpaladino and lariciamota and removed request for a team August 12, 2026 13:47
@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b1d19817-69c0-4ab1-b0e4-b4f71c2508fc

📥 Commits

Reviewing files that changed from the base of the PR and between b2a2448 and 252fe01.

📒 Files selected for processing (1)
  • packages/api/src/platforms/vtex/clients/search/types/ProductSearchResult.ts

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


Walkthrough

The exported VTEX Item interface retains videos: string[] and adds an optional deprecated Videos?: string[] compatibility alias.

Changes

VTEX search result type compatibility

Layer / File(s) Summary
Preserve the Item video property compatibility
packages/api/src/platforms/vtex/clients/search/types/ProductSearchResult.ts
The exported Item interface retains videos: string[] and adds the deprecated optional alias Videos?: string[].

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 252fe

This localized type correction aligns the item video field with the lowercase payload shape while preserving its string array type; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: gabpaladino, lariciamota, eduardoformiga

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: correcting the casing of the API item videos field. It is concise and consistent with the backward-compatible videos and Videos interface updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

✨ 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.

@codesandbox-ci

codesandbox-ci Bot commented Aug 12, 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.

@hellofanny

Copy link
Copy Markdown
Contributor

@evander-corebiz Thanks for tracking this down — the type/payload mismatch is real (confirmed Videos doesn't appear anywhere in the repo except this one declaration, and all the test fixtures already use lowercase videos).

One concern with the rename as-is: Item is explicitly re-exported from @faststore/api public entry point (src/index.ts) 🫤

To avoid a breaking change here, I'm suggesting an alternative here: add the correct field instead of renaming, and deprecate the old one. The old field can be removed cleanly in a future major version with its own BREAKING CHANGE: note. Does this approach work for you?

@evander-corebiz

Copy link
Copy Markdown
Contributor Author

@evander-corebiz Thanks for tracking this down — the type/payload mismatch is real (confirmed Videos doesn't appear anywhere in the repo except this one declaration, and all the test fixtures already use lowercase videos).

One concern with the rename as-is: Item is explicitly re-exported from @faststore/api public entry point (src/index.ts) 🫤

To avoid a breaking change here, I'm suggesting an alternative here: add the correct field instead of renaming, and deprecate the old one. The old field can be removed cleanly in a future major version with its own BREAKING CHANGE: note. Does this approach work for you?

Yes, I think so. The idea is to be able to use the native type on auto complete and it not break the validations. I apllied the changes. Thanks!

@sonar-workflows

Copy link
Copy Markdown

@hellofanny
hellofanny merged commit 80c5fd7 into vtex:dev Aug 25, 2026
6 checks passed
thiagopereira-vtex pushed a commit that referenced this pull request Aug 25, 2026
## What's the purpose of this pull request?

The `Item` type in the VTEX Search API client declares the video field
as `Videos`, but the FastStore GraphQL search response returns it as
`videos`.

This mismatch makes the internal TypeScript type inconsistent with the
actual payload and may cause incorrect property access for SKU videos.

This PR updates the field casing while preserving its existing
`string[]` type.

## How it works?

The `Item` interface now declares the field as:

```ts
videos: string[]
```

No runtime behavior or public GraphQL schema was changed.

## How to test it?

* Confirm that `ProductSearchResult.Item` exposes `videos` as
`string[]`.
* Run the Biome validation:

```bash
pnpm exec biome check packages/api/src/platforms/vtex/clients/search/types/ProductSearchResult.ts
```

* Validate the diff:

```bash
git diff --check
```

Both checks should pass.

### Starters Deploy Preview

Not applicable. This is a type-only change with no storefront UI or
runtime behavior changes.

## References

* [[VTEX Search GraphQL
documentation](https://developers.vtex.com/docs/apps/vtex.search-graphql)](https://developers.vtex.com/docs/apps/vtex.search-graphql)
* [[VTEX product search response
example](https://developers.vtex.com/docs/guides/consult-product-search-information)](https://developers.vtex.com/docs/guides/consult-product-search-information)
* Actual FastStore search fixtures already use `videos` in lowercase.

## Checklist

<em>You may erase this after checking them all 😉</em>

**PR Title and Commit Messages**

* [x] PR title and commit messages follow the [[Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/)](https://www.conventionalcommits.org/en/v1.0.0/)
specification

* Available prefixes: `feat`, `fix`, `chore`, `docs`, `style`,
`refactor`, `ci` and `test`
  * Prefix used: `fix`
  * Scope used: `api`

**PR Description**

* [x] Added a label according to the PR goal - `breaking change`, `bug`,
`contributing`, `performance`, `documentation`..

  * Label used: `bug`

**Dependencies**

* [x] Committed the `pnpm-lock.yaml` file when there were changes to the
packages

* No dependencies or package versions were changed, so `pnpm-lock.yaml`
was not modified.

**Documentation**

* [x] PR description
* [x] For documentation changes, ping `@Mariana-Caetano` to review and
update (Or submit a doc request)

  * Not applicable. This PR only corrects an internal TypeScript type.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

* **Bug Fixes**
* Improved compatibility for product video data in search results by
retaining support for the deprecated `Videos` property alongside
`videos`.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Evander Oliveira <[email protected]>
Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Fanny Chien <[email protected]>
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.

2 participants