Skip to main content
Version: 🚧 Canary

📐 Notification schemas

Notification schemas validate route paths, shared pagination, and the batch-read anchor body.

Inventory

ExportRequest locationContract
updateNotificationToReadSchemaPathRequired string notification ID.
findNotificationsSchemaPath, QueryRequired identity ID plus pagination.
updateNotificationToReadBatchSchemaPath, bodyIdentity ID and strict read-anchor body.
Shared parameter definitions
const notificationIdPathParameter: OpenAPIParameter = {
in: 'path',
name: 'notificationId',
required: true,
schema: {
type: 'string',
},
};

export const identityIdPathParameter: OpenAPIParameter = {
in: 'path',
name: 'identityId',
required: true,
schema: {
type: 'string',
},
};

export const paginationQueryParametersSchema: OpenAPIParameter[] = [
{
in: 'query',
name: 'page',
required: false,
schema: {maximum: 1000, minimum: 1, type: 'integer'},
},
{
in: 'query',
name: 'limit',
required: false,
schema: {maximum: 50, minimum: 1, type: 'integer'},
},
];

Details

updateNotificationToReadSchema

Definition

Used by route: updateNotificationToReadRoute. Used by feature: updateNotificationToReadFeature.

LocationFieldTypeRequiredConstraints
PathnotificationIdstringYesNo format or pattern.
View complete source
export const updateNotificationToReadSchema = withSchema({
parameters: [{...notificationIdPathParameter}],
});

findNotificationsSchema

Definition

Used by route: findNotificationsRoute. Used by feature: findNotificationsFeature. It has no body.

LocationFieldTypeRequiredConstraints
PathidentityIdstringYesNo format or pattern.
QuerypageintegerNoMinimum 1, maximum 1000.
QuerylimitintegerNoMinimum 1, maximum 50.
View complete source
export const findNotificationsSchema = withSchema({
parameters: [
{
in: 'path',
name: 'identityId',
required: true,
schema: {
type: 'string',
},
},
...paginationQueryParametersSchema,
],
});

updateNotificationToReadBatchSchema

Definition

Used by route: updateNotificationToReadBatchRoute. Used by feature: updateNotificationToReadBatchFeature. The body is required and strict (additionalProperties: false).

LocationFieldTypeRequiredConstraints
PathidentityIdstringYesShared identity path parameter; no format or pattern.
BodylastReadNotificationIdstringYesRequired application/json property; no additional body properties.
View complete source
export const updateNotificationToReadBatchSchema = withSchema({
parameters: [
{
...identityIdPathParameter,
},
],
requestBody: {
content: {
'application/json': {
schema: {
$schema: 'http://json-schema.org/draft-07/schema#',
additionalProperties: false,
properties: {
lastReadNotificationId: {type: 'string'},
},
required: ['lastReadNotificationId'],
type: 'object',
},
},
},
required: true,
},
});