Skip to main content

Review star ratings validation rules for scale values, distribution accuracy, and rating consistency

Best Rating

BestRatingMustBeInteger

DefinitionSeverityAPISampleMode
Validate that bestRating is an integer
VIOLATION
POST_AND_PUT
S

BestRatingMustBePresent

DefinitionSeverityAPISampleMode
Validate that bestRating is present
VIOLATION
POST_AND_PUT
S

BestRatingNotMatchedInAggregateRatingBestRating

Preconditions
Aggregate Ratings resource exists for same location
DefinitionSeverityAPISampleMode
Validate that bestRating matches bestRating in the Aggregate Rating resource
VIOLATION
POST_AND_PUT
S

RatingValueExceedsBestRating

DefinitionSeverityAPISampleMode
Validate that ratingValue is less than or equal to the review's bestRating
VIOLATION
POST_AND_PUT
S

Category

CategoryMustBeDistinct

DefinitionSeverityAPISampleMode
Validate that each category in a starRatings list is distinct
VIOLATION
POST_AND_PUT
S

CategoryMustBePresent

DefinitionSeverityAPISampleMode
Validate that 'category' is present
VIOLATION
POST_AND_PUT
S

CategoryMustBeValid

DefinitionSeverityAPISampleMode
Validate that category value is OVERALL
VIOLATION
POST_AND_PUT
S

CategoryMustNotBeEmpty

DefinitionSeverityAPISampleMode
Validate that category is not an empty string
VIOLATION
POST_AND_PUT
S
Example Validation Report
{
"code": "VALIDATION__CategoryMustNotBeEmpty",
"severity": "VIOLATION",
"message": "'category' must not be empty string"
}

Rating Value

RatingValueMustBePresent

DefinitionSeverityAPISampleMode
Validate that 'ratingValue' is present
VIOLATION
POST_AND_PUT
S

RatingValueNotWithinAggregateRatingRange

Preconditions
Aggregate Ratings resource exists for same location
DefinitionSeverityAPISampleMode
Validate that ratingValue is equal to or lays between the range that is derived from worstRating and bestRating in the Aggregate Rating resource
VIOLATION
POST_AND_PUT
S

Star Ratings

StarRatingsListMustNotIncludeNulls

DefinitionSeverityAPISampleMode
Validate that a list does not include null
VIOLATION
POST_AND_PUT
Link
S

StarRatingsMustNotBeEmptyArray

DefinitionSeverityAPISampleMode
Validate that starRatings is not an empty array
VIOLATION
POST_AND_PUT
S
Example Validation Report
{
"code": "VALIDATION__StarRatingsMustNotBeEmptyArray",
"message": "'{{field}}' must be omitted or contain at least one element; empty arrays are not allowed.",
"severity": "VIOLATION",
"context": {
"field": "starRatings"
},
"details": {
"compared": [],
"expected": [],
"submitted": [
{
"field": "$.reviewDetails.starRatings",
"value": "[]"
}
],
"createdDate": "2026-03-03T13:58:43.946Z"
}
}

Worst Rating

RatingValueIsLessThanWorstRating

DefinitionSeverityAPISampleMode
Validate that ratingValue is not less than the review's worstRating
VIOLATION
POST_AND_PUT
S

WorstRatingIsPresent

Preconditions
type is CRITIC or USER
DefinitionSeverityAPISampleMode
Validate that worstRating is not present. (Deference is given to Aggregate Rating's worstRating)
WARNING
POST_AND_PUT
S

WorstRatingMustBeInteger

DefinitionSeverityAPISampleMode
Validate that worstRating is an integer
VIOLATION
POST_AND_PUT
S

WorstRatingMustBeValid

DefinitionSeverityAPISampleMode
Validate that worstRating is valid. (Is 0 or 1. Not a non-zero decimal or string data type)
VIOLATION
POST_AND_PUT
S
Example Validation Report
{
"code": "VALIDATION__WorstRatingMustBeValid",
"severity": "VIOLATION",
"message": "'worstRating' value '{{value}}' is not valid",
"context": {
"value": 0.9
},
"details": {
"createdDate": "2026-09-01T21:00:59.865Z",
"submitted": [
{
"field": "$.reviewDetails.review.starRatings[0].worstRating",
"value": 0.9
}
],
"compared": [],
"expected": []
}
}
Example Validation Report
{
"code": "VALIDATION__WorstRatingMustBeValid",
"severity": "VIOLATION",
"message": "'worstRating' value '{{value}}' is not valid",
"context": {
"value": "0"
},
"details": {
"createdDate": "2026-09-01T21:00:59.865Z",
"submitted": [
{
"field": "$.reviewDetails.review.starRatings[0].worstRating",
"value": "0"
}
],
"compared": [],
"expected": []
}
}
Example Validation Report
{
"code": "VALIDATION__WorstRatingMustBeValid",
"severity": "VIOLATION",
"message": "'worstRating' value '{{value}}' is not valid",
"context": {
"value": 2
},
"details": {
"createdDate": "2026-09-01T21:00:59.865Z",
"submitted": [
{
"field": "$.reviewDetails.review.starRatings[0].worstRating",
"value": 2
}
],
"compared": [],
"expected": []
}
}

WorstRatingNotMatchedInAggregateRatingWorstRating

Preconditions
Aggregate rating is associated with the same location
Review has worstRating
DefinitionSeverityAPISampleMode
Validate that the review's worstRating matches the aggregate rating's worstRating
VIOLATION
POST_AND_PUT
S

WorstRatingNotPresent

Preconditions
type is CRITIC_SUMMARY
DefinitionSeverityAPISampleMode
Validate that worstRating is present (When not provided, 0 is assumed)
WARNING
POST_AND_PUT
S