mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Updates 2 of many
This commit is contained in:
@@ -113,11 +113,12 @@ class OASSpecsService implements SpecificationSubService {
|
||||
description: 'Your current Directus instance.',
|
||||
},
|
||||
],
|
||||
tags,
|
||||
paths,
|
||||
components,
|
||||
};
|
||||
|
||||
if (tags) spec.tags = tags;
|
||||
if (components) spec.components = components;
|
||||
|
||||
return spec;
|
||||
}
|
||||
|
||||
@@ -145,11 +146,16 @@ class OASSpecsService implements SpecificationSubService {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
tags.push({
|
||||
const tag: TagObject = {
|
||||
name: 'Items' + formatTitle(collection.collection).replace(/ /g, ''),
|
||||
description: collection.meta?.note || undefined,
|
||||
'x-collection': collection.collection,
|
||||
});
|
||||
};
|
||||
|
||||
if (collection.meta?.note) {
|
||||
tag.description = collection.meta.note;
|
||||
}
|
||||
|
||||
tags.push(tag);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -404,10 +410,15 @@ class OASSpecsService implements SpecificationSubService {
|
||||
}
|
||||
|
||||
private generateField(field: Field, relations: Relation[], tags: TagObject[], fields: Field[]): SchemaObject {
|
||||
let propertyObject: SchemaObject = {
|
||||
nullable: field.schema?.is_nullable,
|
||||
description: field.meta?.note || undefined,
|
||||
};
|
||||
let propertyObject: SchemaObject = {};
|
||||
|
||||
if (field.schema && 'is_nullable' in field.schema) {
|
||||
propertyObject.nullable = field.schema.is_nullable;
|
||||
}
|
||||
|
||||
if (field.meta?.note) {
|
||||
propertyObject.description = field.meta.note;
|
||||
}
|
||||
|
||||
const relation = relations.find(
|
||||
(relation) =>
|
||||
@@ -482,14 +493,7 @@ class OASSpecsService implements SpecificationSubService {
|
||||
return propertyObject;
|
||||
}
|
||||
|
||||
private fieldTypes: Record<
|
||||
Type,
|
||||
{
|
||||
type?: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'integer' | 'null' | undefined;
|
||||
format?: string;
|
||||
items?: any;
|
||||
}
|
||||
> = {
|
||||
private fieldTypes: Record<Type, Partial<SchemaObject>> = {
|
||||
alias: {
|
||||
type: 'string',
|
||||
},
|
||||
@@ -546,9 +550,7 @@ class OASSpecsService implements SpecificationSubService {
|
||||
type: 'string',
|
||||
format: 'timestamp',
|
||||
},
|
||||
unknown: {
|
||||
type: undefined,
|
||||
},
|
||||
unknown: {},
|
||||
uuid: {
|
||||
type: 'string',
|
||||
format: 'uuid',
|
||||
|
||||
@@ -15,7 +15,7 @@ export type ColPathProps = {
|
||||
export type ColPathResult = {
|
||||
columnPath: string;
|
||||
targetCollection: string;
|
||||
addNestedPkField?: string;
|
||||
addNestedPkField: string | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,8 +7,8 @@ import { InvalidQueryException } from '../exceptions';
|
||||
import { applyFunctionToColumnName } from './apply-function-to-column-name';
|
||||
|
||||
type GetColumnOptions = {
|
||||
query?: Query;
|
||||
originalCollectionName?: string;
|
||||
query?: Query | undefined;
|
||||
originalCollectionName?: string | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user