Skip to content

Type errors against Google's recommended Schema JSON-LD's #130

Closed
@BenRacicot

Description

@BenRacicot

Firstly, thank you for this lib and your maintenance of it.

After setting up the typings and using them against Google's recommended Schema markup. In this case I'm seeing errors against Product and it's nested aggregateRating can you help me understand how to use these typings with Google's recommended versions?

Error:

(property) "aggregateRating"?: SchemaValue<IdReference | AggregateRatingLeaf | EmployerAggregateRatingLeaf>
The overall rating, based on a collection of reviews or ratings, of the item.

Type '{ "@type": "AggregateRating"; ratingValue: string; reviewCount: string; }' is not assignable to type 'SchemaValue<IdReference | AggregateRatingLeaf | EmployerAggregateRatingLeaf>'.
  Types of property '"reviewCount"' are incompatible.
    Type 'string' is not assignable to type 'SchemaValue<number>'.ts(2322)
schema.d.ts(8042, 5): The expected type comes from property 'aggregateRating' which is declared here on type 'Product'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions