Skip to content

Conversation

@weotch
Copy link
Member

@weotch weotch commented Sep 10, 2025

This matches how Contentful codegen-ed types are returned

This matches how Contentful codegen-ed types are returned
@weotch weotch requested a review from Copilot September 10, 2025 02:28
@codesandbox
Copy link

codesandbox bot commented Sep 10, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates Contentful type definitions to make all fields optional and nullable, aligning with how Contentful's code-generated types are actually returned from the API.

Key changes:

  • Makes required fields optional and adds null union types to existing optional fields
  • Updates dependent code to handle the new nullable field types
  • Ensures type safety when accessing previously required fields

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/contentful/src/types/contentfulVisualTypes.ts Updates type definitions to make all fields optional and nullable
packages/contentful/src/lib/aspectRatio.ts Adds null checks for width and height fields that are now nullable

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@weotch weotch merged commit ce84a08 into main Sep 10, 2025
4 checks passed
@weotch weotch deleted the loosen-contentful-types branch September 10, 2025 02:31
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