Skip to content

Commit

Permalink
Update publish ref pattern in app context (#730)
Browse files Browse the repository at this point in the history
Update publish ref pattern in app context
  • Loading branch information
apaleslimghost authored Jan 21, 2020
2 parents 79992c2 + f888951 commit ab9f5d6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/dotcom-server-app-context/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ The publish reference of the content on the current page

Additional restrictions:

* Regex pattern: `^tid_.+$`
* Regex pattern: `tid_`
4 changes: 2 additions & 2 deletions packages/dotcom-server-app-context/src/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
"publishReference": {
"type": "string",
"description": "The publish reference of the content on the current page",
"examples": ["tid_17wmwszvk3"],
"pattern": "^tid_.+$"
"examples": ["tid_17wmwszvk3", "SYNTHETIC-REQ-MONtid_UrnYVM6Waz_carousel_1534570047"],
"pattern": "tid_"
}
}
}
2 changes: 1 addition & 1 deletion packages/dotcom-server-app-context/src/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ export default function validate(field: string, value): boolean {
if (isValid(data)) {
return true
} else {
throw Error(`Validation error: ${ajv.errorsText(isValid.errors)}`)
throw Error(`Validation error: ${ajv.errorsText(isValid.errors)}, received "${value}"`)
}
}

0 comments on commit ab9f5d6

Please sign in to comment.