Skip to main content

Validation rules for star rating components including ratings, counts, categories, and value ranges

Best Rating​

BestRatingMustBePresent​

DefinitionSeverityAPISampleMode
Validate that 'bestRating' is present
VIOLATION
POST_AND_PUT
S

BestRatingMustBeValid​

DefinitionSeverityAPISampleMode
Validate that 'bestRating' is valid. (Not zero, non-zero decimal or string data type)
VIOLATION
POST_AND_PUT
S
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​

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": "'{{field}}' must not be empty string",
"context": {
"field": "category"
},
"details": {
"createdDate": "2026-09-01T21:00:59.865Z",
"submitted": [],
"compared": [],
"expected": []
}
}

CategoryMustBeDistinct​

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

Change Detection​

RatingCountIsReduced​

DefinitionSeverityAPISampleMode
Validate that the count of ratings is equal to or greater than the last submittal
WARNING
PUT
S

ReviewCountIsReduced​

DefinitionSeverityAPISampleMode
Validate that the count of reviews is equal to or greater than the last submittal
WARNING
PUT
S

Rating Count​

RatingCountIsZero​

Preconditions
distribution is not present
DefinitionSeverityAPISampleMode
Validate that 'ratingCount' is not zero
WARNING
POST_AND_PUT
S

RatingCountMustBePresent​

DefinitionSeverityAPISampleMode
Validate that 'ratingCount' is present
VIOLATION
POST_AND_PUT
S

RatingCountMustNotBeZero​

Preconditions
distribution is present
DefinitionSeverityAPISampleMode
Validate that 'ratingCount' is not zero
VIOLATION
POST_AND_PUT
S

Rating Value​

RatingValueMustBePresent​

DefinitionSeverityAPISampleMode
Validate that 'ratingValue' is present
VIOLATION
POST_AND_PUT
S

RatingValueNotWithinDerivedRange​

DefinitionSeverityAPISampleMode
Validate that ratingValue is equal to or lays between the range that is derived from worstRating and bestRating
VIOLATION
POST_AND_PUT
S

Review Count​

ReviewCountIsZero​

DefinitionSeverityAPISampleMode
Validate that 'reviewCount' is not zero
WARNING
POST_AND_PUT
S

ReviewCountMustBePresent​

DefinitionSeverityAPISampleMode
Validate that 'reviewCount' is present
VIOLATION
POST_AND_PUT
S

Worst Rating​

WorstRatingMustBePresent​

DefinitionSeverityAPISampleMode
Validate that 'worstRating' is present
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": "$.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": []
}
}