5581 get httpsapitwentycomrestmetadata relations not working (#5867)
Filtering relations is not allowed (see`packages/twenty-server/src/engine/metadata-modules/relation-metadata/dtos/relation-metadata.dto.ts`) so we remove filtering for find many relation we also fixed some bug in result structure and metadata open-api schema
This commit is contained in:
@ -133,7 +133,10 @@ export class OpenApiService {
|
||||
get: {
|
||||
tags: [item.namePlural],
|
||||
summary: `Find Many ${item.namePlural}`,
|
||||
parameters: [{ $ref: '#/components/parameters/filter' }],
|
||||
parameters:
|
||||
item.namePlural !== 'relations'
|
||||
? [{ $ref: '#/components/parameters/filter' }]
|
||||
: undefined,
|
||||
responses: {
|
||||
'200': getFindManyResponse200(item),
|
||||
'400': { $ref: '#/components/responses/400' },
|
||||
|
||||
@ -240,7 +240,7 @@ export const computeMetadataSchemaComponents = (
|
||||
(schemas, item) => {
|
||||
switch (item.nameSingular) {
|
||||
case 'object': {
|
||||
schemas[`${capitalize(item.nameSingular)}`] = {
|
||||
schemas[`${capitalize(item.nameSingular)} with Relations`] = {
|
||||
type: 'object',
|
||||
description: `An object`,
|
||||
properties: {
|
||||
@ -290,7 +290,7 @@ export const computeMetadataSchemaComponents = (
|
||||
return schemas;
|
||||
}
|
||||
case 'field': {
|
||||
schemas[`${capitalize(item.nameSingular)}`] = {
|
||||
schemas[`${capitalize(item.nameSingular)} with Relations`] = {
|
||||
type: 'object',
|
||||
description: `A field`,
|
||||
properties: {
|
||||
@ -358,7 +358,7 @@ export const computeMetadataSchemaComponents = (
|
||||
return schemas;
|
||||
}
|
||||
case 'relation': {
|
||||
schemas[`${capitalize(item.nameSingular)}`] = {
|
||||
schemas[`${capitalize(item.nameSingular)} with Relations`] = {
|
||||
type: 'object',
|
||||
description: 'A relation',
|
||||
properties: {
|
||||
|
||||
Reference in New Issue
Block a user