Validation rules for star rating components including ratings, counts, categories, and value ranges
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 |
BestRatingMustBeValid
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
| Validate that 'bestRating' is valid. (Not zero, non-zero decimal or string data type) |
Example Validation Report
{
"code": "VALIDATION__BestRatingMustBeValid",
"severity": "VIOLATION",
"message": "'bestRating' value '{{value}}' is not valid",
"context": {
"value": 5.1
},
"details": {
"createdDate": "2026-09-01T21:00:59.865Z",
"submitted": [
{
"field": "$.aggregateRatingDetails.starRatings.bestRating",
"value": 5.1
}
],
"compared": [],
"expected": []
}
}
Example Validation Report
{
"code": "VALIDATION__BestRatingMustBeValid",
"severity": "VIOLATION",
"message": "'bestRating' value '{{value}}' is not valid",
"context": {
"value": "5"
},
"details": {
"createdDate": "2026-09-01T21:00:59.865Z",
"submitted": [
{
"field": "$.aggregateRatingDetails.starRatings.bestRating",
"value": "5"
}
],
"compared": [],
"expected": []
}
}
Example Validation Report
{
"code": "VALIDATION__BestRatingMustBeValid",
"severity": "VIOLATION",
"message": "'bestRating' value '{{value}}' is not valid",
"context": {
"value": 0
},
"details": {
"createdDate": "2026-09-01T21:00:59.865Z",
"submitted": [
{
"field": "$.aggregateRatingDetails.starRatings.bestRating",
"value": 0
}
],
"compared": [],
"expected": []
}
}
Category
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"
}
CategoryMustBeDistinct
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that each category in a starRatings list is distinct (1) |
Change Detection
RatingCountIsReduced
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
| Validate that the count of ratings is equal to or greater than the last submittal |
ReviewCountIsReduced
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
| Validate that the count of reviews is equal to or greater than the last submittal |
Rating Count
RatingCountIsZero
| Preconditions |
|---|
distribution is not present |
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
| Validate that 'ratingCount' is not zero |
RatingCountMustBePresent
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
| Validate that 'ratingCount' is present |
RatingCountMustBeInteger
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
| Validate that 'ratingCount' is an integer |
RatingCountMustNotBeZero
| Preconditions |
|---|
distribution is present |
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
| Validate that 'ratingCount' is not zero |
RatingCountIsLessThanIntervalsTotal
| Preconditions |
|---|
distribution is present |
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that 'ratingCount' is not less than the sum of all distribution interval values |
Rating Value
RatingValueMustBePresent
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
| Validate that 'ratingValue' is present |
RatingValueMustBeNumber
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
| Validate that 'ratingValue' is a number |
RatingValueNotWithinDerivedRange
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that ratingValue is equal to or lays between the range that is derived from worstRating and bestRating |
Review Count
ReviewCountIsZero
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
| Validate that 'reviewCount' is not zero |
ReviewCountMustBePresent
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
| Validate that 'reviewCount' is present |
ReviewCountMustBeInteger
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
| Validate that 'reviewCount' is an integer |
Worst Rating
WorstRatingMustBeInteger
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
| Validate that 'worstRating' is an integer |
WorstRatingMustBePresent
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
| Validate that 'worstRating' is present |
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": "$.aggregateRatingDetails.starRatings.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": "$.aggregateRatingDetails.starRatings.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": "$.aggregateRatingDetails.starRatings.worstRating",
"value": 2
}
],
"compared": [],
"expected": []
}
}