mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-19 16:13:06 +00:00
fix: generate schemas for type aliases
This commit is contained in:
@@ -14,13 +14,13 @@
|
||||
*/
|
||||
import Ajv from 'ajv';
|
||||
import {JSONSchema7 as JSONSchema} from 'json-schema';
|
||||
import {filter} from 'lodash';
|
||||
import {chain} from 'lodash';
|
||||
import {Config, DEFAULT_CONFIG, Definition, SchemaGenerator} from 'ts-json-schema-generator';
|
||||
import {createFormatter} from 'ts-json-schema-generator/dist/factory/formatter';
|
||||
import {createParser} from 'ts-json-schema-generator/dist/factory/parser';
|
||||
import {createProgram} from 'ts-json-schema-generator/dist/factory/program';
|
||||
import {getTsconfigPath} from './common';
|
||||
import {definitionsOf, isLightweightClass} from './easy-ast/ast-util';
|
||||
import {definitionsOf} from './easy-ast/ast-util';
|
||||
import {lightweightProjectFromPath} from './easy-ast/easy-ast';
|
||||
import {isSchemaWithDefinitions} from './util/guards';
|
||||
import path from 'path';
|
||||
@@ -113,7 +113,8 @@ export class Converter {
|
||||
* Get a list of validatable types from an API extractor file
|
||||
*/
|
||||
export function getValidatableTypesInPath(path: string): string[] {
|
||||
return filter(definitionsOf(lightweightProjectFromPath(path)), isLightweightClass)
|
||||
.filter(type => type.comment?.tags?.find(it => it.name === 'validatable'))
|
||||
.map(type => type.name);
|
||||
return chain(definitionsOf(lightweightProjectFromPath(path)))
|
||||
.filter(type => !!type.comment?.tags?.find(it => it.name === 'validatable'))
|
||||
.map(type => type.name)
|
||||
.value();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user