3035 improve rest api syntax (#3047)

This commit is contained in:
martmull
2023-12-18 13:46:21 +01:00
committed by GitHub
parent b36d86e52c
commit 576492f3c0
6 changed files with 102 additions and 39 deletions

View File

@ -13,21 +13,11 @@ export const getManyResultResponse200 = (item: ObjectMetadataEntity) => {
type: 'object',
properties: {
[item.namePlural]: {
type: 'object',
properties: {
edges: {
type: 'array',
items: {
type: 'object',
properties: {
node: {
$ref: `#/components/schemas/${capitalize(
item.nameSingular,
)}`,
},
},
},
},
type: 'array',
items: {
$ref: `#/components/schemas/${capitalize(
item.nameSingular,
)}`,
},
},
},
@ -35,16 +25,10 @@ export const getManyResultResponse200 = (item: ObjectMetadataEntity) => {
},
example: {
data: {
properties: {
[item.namePlural]: {
edges: [
{
node: `${capitalize(item.nameSingular)}Object`,
},
'...',
],
},
},
[item.namePlural]: [
`${capitalize(item.nameSingular)}Object`,
'...',
],
},
},
},