Review star ratings validation rules for scale values, distribution accuracy, and rating consistency
Best Rating
BestRatingMustBeInteger
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that bestRating is an integer |
BestRatingMustBePresent
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that bestRating is present |
BestRatingNotMatchedInAggregateRatingBestRating
| Preconditions |
|---|
| Aggregate Ratings resource exists for same location |
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that bestRating matches bestRating in the Aggregate Rating resource |
RatingValueExceedsBestRating
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that ratingValue is less than or equal to the review's bestRating |
Category
CategoryMustBeDistinct
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that each category in a starRatings list is distinct |
CategoryMustBePresent
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
| Validate that 'category' is present |
CategoryMustBeValid
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that category value is OVERALL |
CategoryMustNotBeEmpty
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that category is not an empty string |
Example Validation Report
{
"code": "VALIDATION__CategoryMustNotBeEmpty",
"severity": "VIOLATION",
"message": "'category' must not be empty string"
}
Rating Value
RatingValueMustBePresent
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
| Validate that 'ratingValue' is present |
RatingValueNotWithinAggregateRatingRange
| Preconditions |
|---|
| Aggregate Ratings resource exists for same location |
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that ratingValue is equal to or lays between the range that is derived from worstRating and bestRating in the Aggregate Rating resource |
Star Ratings
StarRatingsListMustNotIncludeNulls
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
| Validate that a list does not include null | Link |
StarRatingsMustNotBeEmptyArray
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that starRatings is not an empty array |
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
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that ratingValue is not less than the review's worstRating |
WorstRatingIsPresent
| Preconditions |
|---|
type is CRITIC or USER |
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that worstRating is not present. (Deference is given to Aggregate Rating's worstRating) |
WorstRatingMustBeInteger
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that worstRating is an integer |
WorstRatingMustBeValid
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that worstRating is valid. (Is 0 or 1. Not a non-zero decimal or string data type) |
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 |
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that the review's worstRating matches the aggregate rating's worstRating |
WorstRatingNotPresent
| Preconditions |
|---|
type is CRITIC_SUMMARY |
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that worstRating is present (When not provided, 0 is assumed) |