mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-09 11:12:52 +00:00
refactor: update dependencies and fix resulting errors
Upgraded JSON Schema from version 6 to version 7 Upgraded TypeDoc version to latest Replaced 'jsonschema' with 'json-schema' package to better comply with 'ts-json-schema-generator' Replace JSON Schema validation with AJV in areas where it wasn't used previously Removed commander help output as it causes strange issues
This commit is contained in:
committed by
Rainer Killinger
parent
b7cdb6a9ad
commit
5330255b7e
@@ -73,11 +73,11 @@ export class CreateDiagramSpec {
|
||||
let fileName = await createDiagram(this.definitions, this.plantUmlConfig, "http://plantuml:8080");
|
||||
let filePath = resolve(__dirname, '..', fileName);
|
||||
expect(await existsSync(filePath)).to.equal(true);
|
||||
|
||||
await unlinkSync(fileName);
|
||||
|
||||
this.plantUmlConfig.showAssociations = false;
|
||||
this.plantUmlConfig.showInheritance = false;
|
||||
|
||||
this.plantUmlConfig.showInheritance = false;
|
||||
fileName = await createDiagram(this.definitions, this.plantUmlConfig, "http://plantuml:8080");
|
||||
filePath = resolve(__dirname, '..', fileName);
|
||||
expect(await existsSync(filePath)).to.equal(true);
|
||||
|
||||
@@ -22,17 +22,21 @@ import {ElasticsearchDataType} from '../../../../src/mappings/definitions/typema
|
||||
* @indexable
|
||||
*/
|
||||
export interface ObjectUnion {
|
||||
foo: Bar | Baz;
|
||||
foo: Boo | Buu;
|
||||
|
||||
type: ThingType.ObjectUnion
|
||||
}
|
||||
|
||||
interface Bar {
|
||||
// we can't name them Bar or Baz, look here for more info:
|
||||
// https://gitlab.com/openstapps/core-tools/-/issues/48
|
||||
// or here
|
||||
// https://github.com/TypeStrong/typedoc/issues/1373
|
||||
interface Boo {
|
||||
a: boolean;
|
||||
intersection: string;
|
||||
}
|
||||
|
||||
interface Baz {
|
||||
interface Buu {
|
||||
b: number;
|
||||
intersection: string;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ import {genericTest} from './mapping-model/mappings/src/generics';
|
||||
import {nestedTest} from './mapping-model/mappings/src/nested';
|
||||
import {indexSignatureTest} from './mapping-model/mappings/src/index-signature';
|
||||
import {impossibleUnionTest} from './mapping-model/mappings/src/impossible-union';
|
||||
import {typeQueryTest} from './mapping-model/mappings/src/type-query';
|
||||
import {objectUnionTest} from './mapping-model/mappings/src/object-union';
|
||||
import {sortableTagTest} from './mapping-model/mappings/src/sortable-tag';
|
||||
import {enumTest} from './mapping-model/mappings/src/enum';
|
||||
@@ -91,10 +90,12 @@ export class MappingSpec {
|
||||
magAppInstance.testInterfaceAgainstPath(objectUnionTest);
|
||||
}
|
||||
|
||||
/*
|
||||
https://gitlab.com/openstapps/core-tools/-/issues/47
|
||||
@test
|
||||
async 'Type queries should work'() {
|
||||
magAppInstance.testInterfaceAgainstPath(typeQueryTest);
|
||||
}
|
||||
}*/
|
||||
|
||||
@test
|
||||
async 'Impossible union should cause an error'() {
|
||||
|
||||
@@ -16,9 +16,7 @@ import {LightweightClassDefinition} from '../../src/uml/model/lightweight-class-
|
||||
import {LightweightDefinition} from '../../src/uml/model/lightweight-definition';
|
||||
import {LightweightEnumDefinition} from '../../src/uml/model/lightweight-enum-definition';
|
||||
|
||||
export const generatedModel: Array<
|
||||
LightweightDefinition | LightweightClassDefinition | LightweightEnumDefinition
|
||||
> = [
|
||||
export const generatedModel: Array<LightweightDefinition | LightweightClassDefinition | LightweightEnumDefinition> = [
|
||||
{
|
||||
name: 'TestClass',
|
||||
type: 'class',
|
||||
@@ -73,7 +71,7 @@ export const generatedModel: Array<
|
||||
{
|
||||
name: 'test2',
|
||||
optional: false,
|
||||
inherited: true,
|
||||
inherited: true,
|
||||
type: {
|
||||
hasTypeInformation: true,
|
||||
isArray: false,
|
||||
@@ -92,7 +90,7 @@ export const generatedModel: Array<
|
||||
{
|
||||
name: 'test4',
|
||||
optional: false,
|
||||
inherited: true,
|
||||
inherited: true,
|
||||
type: {
|
||||
hasTypeInformation: true,
|
||||
isArray: false,
|
||||
@@ -169,42 +167,13 @@ export const generatedModel: Array<
|
||||
isLiteral: false,
|
||||
isPrimitive: false,
|
||||
isReference: false,
|
||||
isReflection: false,
|
||||
isReflection: true,
|
||||
isTyped: false,
|
||||
isTypeParameter: false,
|
||||
isUnion: true,
|
||||
specificationTypes: [
|
||||
{
|
||||
hasTypeInformation: true,
|
||||
isArray: false,
|
||||
isLiteral: false,
|
||||
isPrimitive: true,
|
||||
isReference: false,
|
||||
isReflection: false,
|
||||
isTyped: false,
|
||||
isTypeParameter: false,
|
||||
isUnion: false,
|
||||
specificationTypes: [],
|
||||
genericsTypes: [],
|
||||
name: 'undefined',
|
||||
},
|
||||
{
|
||||
hasTypeInformation: false,
|
||||
isArray: false,
|
||||
isLiteral: false,
|
||||
isPrimitive: false,
|
||||
isReference: false,
|
||||
isReflection: true,
|
||||
isTyped: false,
|
||||
isTypeParameter: false,
|
||||
isUnion: false,
|
||||
specificationTypes: [],
|
||||
genericsTypes: [],
|
||||
name: 'object',
|
||||
},
|
||||
],
|
||||
isUnion: false,
|
||||
specificationTypes: [],
|
||||
genericsTypes: [],
|
||||
name: '',
|
||||
name: 'object',
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -279,47 +248,18 @@ export const generatedModel: Array<
|
||||
optional: true,
|
||||
inherited: false,
|
||||
type: {
|
||||
hasTypeInformation: false,
|
||||
hasTypeInformation: true,
|
||||
isArray: false,
|
||||
isLiteral: false,
|
||||
isPrimitive: false,
|
||||
isPrimitive: true,
|
||||
isReference: false,
|
||||
isReflection: false,
|
||||
isTyped: false,
|
||||
isTypeParameter: false,
|
||||
isUnion: true,
|
||||
specificationTypes: [
|
||||
{
|
||||
hasTypeInformation: true,
|
||||
isArray: false,
|
||||
isLiteral: false,
|
||||
isPrimitive: true,
|
||||
isReference: false,
|
||||
isReflection: false,
|
||||
isTyped: false,
|
||||
isTypeParameter: false,
|
||||
isUnion: false,
|
||||
specificationTypes: [],
|
||||
genericsTypes: [],
|
||||
name: 'undefined',
|
||||
},
|
||||
{
|
||||
hasTypeInformation: true,
|
||||
isArray: false,
|
||||
isLiteral: false,
|
||||
isPrimitive: true,
|
||||
isReference: false,
|
||||
isReflection: false,
|
||||
isTyped: false,
|
||||
isTypeParameter: false,
|
||||
isUnion: false,
|
||||
specificationTypes: [],
|
||||
genericsTypes: [],
|
||||
name: 'number',
|
||||
},
|
||||
],
|
||||
isUnion: false,
|
||||
specificationTypes: [],
|
||||
genericsTypes: [],
|
||||
name: '',
|
||||
name: 'number',
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -506,7 +446,7 @@ export const generatedModel: Array<
|
||||
isArray: false,
|
||||
isLiteral: false,
|
||||
isPrimitive: false,
|
||||
isReference: false,
|
||||
isReference: true,
|
||||
isReflection: false,
|
||||
isTyped: false,
|
||||
isTypeParameter: false,
|
||||
|
||||
@@ -33,7 +33,8 @@ export class SchemaSpec {
|
||||
|
||||
const schema = converter.getSchema('Foo', '0.0.1');
|
||||
expect(schema).to.be.deep.equal({
|
||||
$schema: 'http://json-schema.org/draft-06/schema#',
|
||||
$id: 'https://core.stapps.tu-berlin.de/v0.0.1/lib/schema/Foo.json',
|
||||
$schema: 'http://json-schema.org/draft-07/schema#',
|
||||
additionalProperties: false,
|
||||
definitions: {
|
||||
FooType: {
|
||||
@@ -67,7 +68,6 @@ export class SchemaSpec {
|
||||
},
|
||||
},
|
||||
description: 'This is a simple interface declaration for\ntesting the schema generation and validation.',
|
||||
id: 'https://core.stapps.tu-berlin.de/v0.0.1/lib/schema/Foo.json',
|
||||
properties: {
|
||||
lorem: {
|
||||
description: 'Dummy parameter',
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
import {Logger} from '@openstapps/logger';
|
||||
import {expect} from 'chai';
|
||||
import {existsSync, mkdirSync, writeFileSync} from 'fs';
|
||||
import {Schema} from 'jsonschema';
|
||||
import {JSONSchema7 as Schema} from 'json-schema';
|
||||
import {slow, suite, test, timeout} from 'mocha-typescript';
|
||||
import {join} from 'path';
|
||||
import rimraf from 'rimraf';
|
||||
|
||||
Reference in New Issue
Block a user