wishlist-app/src/api/config/schemas/wishlist.ts
Benny Samir Hierl b7ec02e5e8 #2 edit mode for wishlist
Signed-off-by: Benny Samir Hierl <bennysamir@posteo.de>
2022-02-13 02:21:00 +01:00

53 lines
1.3 KiB
TypeScript

export const wishlistItemRequestSchema = {
type: 'object',
additionalProperties: false,
required: ['title', 'description'],
properties: {
title: { type: 'string' },
url: { type: 'string' },
imageSrc: { type: 'string' },
description: { type: 'string' },
bought: { type: 'boolean' },
},
}
export const wishlistItemResponseSchema = {
type: 'object',
properties: {
id: { type: 'number' },
title: { type: 'string' },
url: { type: 'string' },
imageSrc: { type: 'string' },
description: { type: 'string', maxLength: 300 },
bought: { type: 'boolean' },
wishlistId: { type: 'string' },
},
}
export const wishlistRequestSchema = {
type: 'object',
additionalProperties: false,
required: ['title', 'imageSrc', 'slugUrlText'],
properties: {
title: { type: 'string' },
public: { type: 'boolean' },
imageSrc: { type: 'string' },
description: { type: 'string' },
slugUrlText: { type: 'string' },
},
}
export const wishlistResponseSchema = {
type: 'object',
properties: {
id: { type: 'string' },
title: { type: 'string' },
public: { type: 'boolean' },
imageSrc: { type: 'string' },
description: { type: 'string' },
slugUrlText: { type: 'string' },
items: {
type: 'array',
items: wishlistItemResponseSchema,
},
},
}