From be5b3d301396256c2aff439f359efadbb1e92052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Kilchenmann?= Date: Thu, 9 Sep 2021 04:48:27 +0200 Subject: [PATCH 1/3] chore(deps): bump json2typescript to next rc version --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4866ca2cf..1fcf4b6b8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@babel/helper-compilation-targets": "^7.14.5", "@types/jsonld": "^1.5.0", - "json2typescript": "1.4.1", + "json2typescript": "1.5.0-rc.0", "jsonld": "^5.2.0" }, "devDependencies": { @@ -2585,9 +2585,9 @@ "dev": true }, "node_modules/json2typescript": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/json2typescript/-/json2typescript-1.4.1.tgz", - "integrity": "sha512-l+gmzjK4klnIG4Nr9SdHlhc03e63ln6UN1AASTTufrRoG3MjR443HqGmx/1OMOb/xvp7Ztb7UKZIzxXyDjGSsw==" + "version": "1.5.0-rc.0", + "resolved": "https://registry.npmjs.org/json2typescript/-/json2typescript-1.5.0-rc.0.tgz", + "integrity": "sha512-9v0Q6P38nV9zznaZxHRA8THp5oEGzancSUGgm8NXZSVRU/X8h/RlpP5hutP15J5sMODdx2pz9Fs/SNEpCTFAfA==" }, "node_modules/json5": { "version": "2.2.0", @@ -6856,9 +6856,9 @@ "dev": true }, "json2typescript": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/json2typescript/-/json2typescript-1.4.1.tgz", - "integrity": "sha512-l+gmzjK4klnIG4Nr9SdHlhc03e63ln6UN1AASTTufrRoG3MjR443HqGmx/1OMOb/xvp7Ztb7UKZIzxXyDjGSsw==" + "version": "1.5.0-rc.0", + "resolved": "https://registry.npmjs.org/json2typescript/-/json2typescript-1.5.0-rc.0.tgz", + "integrity": "sha512-9v0Q6P38nV9zznaZxHRA8THp5oEGzancSUGgm8NXZSVRU/X8h/RlpP5hutP15J5sMODdx2pz9Fs/SNEpCTFAfA==" }, "json5": { "version": "2.2.0", diff --git a/package.json b/package.json index 279d0dff1..529d78412 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "dependencies": { "@babel/helper-compilation-targets": "^7.14.5", "@types/jsonld": "^1.5.0", - "json2typescript": "1.4.1", + "json2typescript": "1.5.0-rc.0", "jsonld": "^5.2.0" }, "peerDependencies": { From 3a19e3238b62c0acca030b9bf831af50f7fbd3e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Kilchenmann?= Date: Thu, 9 Sep 2021 05:17:00 +0200 Subject: [PATCH 2/3] chore(deps): bump json2typescript to next version --- src/api/endpoint.ts | 3 +-- src/api/v2/list/lists-endpoint-v2.ts | 4 ++-- src/cache/ListAdminCache.spec.ts | 3 +-- src/cache/ListNodeV2Cache.spec.ts | 4 +--- src/cache/UserCache.spec.ts | 3 +-- ...administrative-permissions-per-project-converter.ts | 4 +--- .../string-literal-to-string-converter.ts | 3 +-- ...string-literal-to-string-literal-array-converter.ts | 3 +-- .../union-data-management-plan-id-converter.ts | 3 +-- .../union-element-array-of-elements-converter.ts | 5 ++--- .../v2/custom-converters/union-metadata-converter.ts | 3 +-- .../union-orgnization-id-converter.ts | 3 +-- .../union-person-organization-id-converter.ts | 3 +-- .../union-single-project-id-converter.ts | 3 +-- src/models/v2/lists/list-node-v2.ts | 2 +- src/models/v2/project-metadata/attribution.ts | 3 +++ .../v2/resources/ResourcesConversionUtil.spec.ts | 3 +-- test/data/api/admin/mock-projects.ts | 10 ++++------ test/data/api/admin/mock-users.ts | 10 ++++------ test/data/api/v2/mock-list.ts | 5 ++--- test/data/api/v2/mock-ontology.ts | 7 +++---- test/data/api/v2/mock-resource.ts | 3 +-- 22 files changed, 35 insertions(+), 55 deletions(-) diff --git a/src/api/endpoint.ts b/src/api/endpoint.ts index 5606ed536..4acc2c2b0 100644 --- a/src/api/endpoint.ts +++ b/src/api/endpoint.ts @@ -1,5 +1,4 @@ -import { JsonConvert, OperationMode, ValueCheckingMode } from "json2typescript"; -import { PropertyMatchingRule } from "json2typescript/src/json2typescript/json-convert-enums"; +import { JsonConvert, OperationMode, PropertyMatchingRule, ValueCheckingMode } from "json2typescript"; import { Observable, throwError } from "rxjs"; import { ajax, AjaxError, AjaxRequest, AjaxResponse } from "rxjs/ajax"; import { KnoraApiConfig } from "../knora-api-config"; diff --git a/src/api/v2/list/lists-endpoint-v2.ts b/src/api/v2/list/lists-endpoint-v2.ts index 1d0f469dc..3a4872324 100644 --- a/src/api/v2/list/lists-endpoint-v2.ts +++ b/src/api/v2/list/lists-endpoint-v2.ts @@ -29,7 +29,7 @@ export class ListsEndpointV2 extends Endpoint { return jsonld.compact(ajaxResponse.response, {}); }), map( - res => { + (res: object) => { return this.jsonConvert.deserialize(res, ListNodeV2) as ListNodeV2; } ), @@ -53,7 +53,7 @@ export class ListsEndpointV2 extends Endpoint { return jsonld.compact(ajaxResponse.response, {}); }), map( - res => { + (res: object) => { return this.jsonConvert.deserialize(res, ListNodeV2) as ListNodeV2; } ), diff --git a/src/cache/ListAdminCache.spec.ts b/src/cache/ListAdminCache.spec.ts index 593a00ca0..f64959667 100644 --- a/src/cache/ListAdminCache.spec.ts +++ b/src/cache/ListAdminCache.spec.ts @@ -1,5 +1,4 @@ -import { JsonConvert, OperationMode, ValueCheckingMode } from "json2typescript"; -import { PropertyMatchingRule } from "json2typescript/src/json2typescript/json-convert-enums"; +import { JsonConvert, OperationMode, PropertyMatchingRule, ValueCheckingMode } from "json2typescript"; import { of } from "rxjs"; import { KnoraApiConfig } from "../knora-api-config"; import { KnoraApiConnection } from "../knora-api-connection"; diff --git a/src/cache/ListNodeV2Cache.spec.ts b/src/cache/ListNodeV2Cache.spec.ts index e70acee67..dce421c72 100644 --- a/src/cache/ListNodeV2Cache.spec.ts +++ b/src/cache/ListNodeV2Cache.spec.ts @@ -1,11 +1,9 @@ -import { JsonConvert, OperationMode, ValueCheckingMode } from "json2typescript"; -import { PropertyMatchingRule } from "json2typescript/src/json2typescript/json-convert-enums"; +import { JsonConvert, OperationMode, PropertyMatchingRule, ValueCheckingMode } from "json2typescript"; import { of } from "rxjs"; import { MockList } from "../../test/data/api/v2/mock-list"; import { KnoraApiConfig } from "../knora-api-config"; import { KnoraApiConnection } from "../knora-api-connection"; import { ListNodeV2 } from "../models/v2/lists/list-node-v2"; -import { ListNodeV2Cache } from "./ListNodeV2Cache"; describe("ListNodeV2Cache", () => { diff --git a/src/cache/UserCache.spec.ts b/src/cache/UserCache.spec.ts index ab7761a1b..0a313d293 100644 --- a/src/cache/UserCache.spec.ts +++ b/src/cache/UserCache.spec.ts @@ -1,5 +1,4 @@ -import { JsonConvert, OperationMode, ValueCheckingMode } from "json2typescript"; -import { PropertyMatchingRule } from "json2typescript/src/json2typescript/json-convert-enums"; +import { JsonConvert, OperationMode, PropertyMatchingRule, ValueCheckingMode } from "json2typescript"; import { of } from "rxjs"; import { KnoraApiConfig } from "../knora-api-config"; import { KnoraApiConnection } from "../knora-api-connection"; diff --git a/src/models/admin/custom-converters/administrative-permissions-per-project-converter.ts b/src/models/admin/custom-converters/administrative-permissions-per-project-converter.ts index 7d4682695..451cf2889 100644 --- a/src/models/admin/custom-converters/administrative-permissions-per-project-converter.ts +++ b/src/models/admin/custom-converters/administrative-permissions-per-project-converter.ts @@ -1,6 +1,4 @@ -import { JsonConvert, JsonConverter, JsonCustomConvert, OperationMode, ValueCheckingMode } from "json2typescript"; -import { PropertyMatchingRule } from "json2typescript/src/json2typescript/json-convert-enums"; - +import { JsonConvert, JsonConverter, JsonCustomConvert, OperationMode, PropertyMatchingRule, ValueCheckingMode } from "json2typescript"; import { Permission } from "../permission"; /** diff --git a/src/models/v2/custom-converters/string-literal-to-string-converter.ts b/src/models/v2/custom-converters/string-literal-to-string-converter.ts index ad1b719dc..1accc3df4 100644 --- a/src/models/v2/custom-converters/string-literal-to-string-converter.ts +++ b/src/models/v2/custom-converters/string-literal-to-string-converter.ts @@ -1,5 +1,4 @@ -import { JsonConvert, JsonConverter, JsonCustomConvert, OperationMode, ValueCheckingMode } from "json2typescript"; -import { PropertyMatchingRule } from "json2typescript/src/json2typescript/json-convert-enums"; +import { JsonConvert, JsonConverter, JsonCustomConvert, OperationMode, PropertyMatchingRule, ValueCheckingMode } from "json2typescript"; import { StringLiteralV2 } from "../string-literal-v2"; /** diff --git a/src/models/v2/custom-converters/string-literal-to-string-literal-array-converter.ts b/src/models/v2/custom-converters/string-literal-to-string-literal-array-converter.ts index 396ef28a0..b19f6f0ff 100644 --- a/src/models/v2/custom-converters/string-literal-to-string-literal-array-converter.ts +++ b/src/models/v2/custom-converters/string-literal-to-string-literal-array-converter.ts @@ -1,5 +1,4 @@ -import { JsonConvert, JsonConverter, JsonCustomConvert, OperationMode, ValueCheckingMode } from "json2typescript"; -import { PropertyMatchingRule } from "json2typescript/src/json2typescript/json-convert-enums"; +import { JsonConvert, JsonConverter, JsonCustomConvert, OperationMode, PropertyMatchingRule, ValueCheckingMode } from "json2typescript"; import { StringLiteralV2 } from "../string-literal-v2"; /** diff --git a/src/models/v2/custom-converters/union-data-management-plan-id-converter.ts b/src/models/v2/custom-converters/union-data-management-plan-id-converter.ts index c99cc1809..6fd8b02bd 100644 --- a/src/models/v2/custom-converters/union-data-management-plan-id-converter.ts +++ b/src/models/v2/custom-converters/union-data-management-plan-id-converter.ts @@ -1,5 +1,4 @@ -import { JsonConvert, JsonConverter, JsonCustomConvert, OperationMode, ValueCheckingMode } from "json2typescript"; -import { PropertyMatchingRule } from "json2typescript/src/json2typescript/json-convert-enums"; +import { JsonConvert, JsonConverter, JsonCustomConvert, OperationMode, PropertyMatchingRule, ValueCheckingMode } from "json2typescript"; import { IId } from "../../../interfaces/models/v2/project-metadata-interfaces"; import { Constants } from "../Constants"; import { DataManagementPlan } from "../project-metadata/data-management-plan"; diff --git a/src/models/v2/custom-converters/union-element-array-of-elements-converter.ts b/src/models/v2/custom-converters/union-element-array-of-elements-converter.ts index 72cb6029e..2f6c48a94 100644 --- a/src/models/v2/custom-converters/union-element-array-of-elements-converter.ts +++ b/src/models/v2/custom-converters/union-element-array-of-elements-converter.ts @@ -1,5 +1,4 @@ -import { JsonConvert, JsonConverter, JsonCustomConvert, OperationMode, ValueCheckingMode } from "json2typescript"; -import { PropertyMatchingRule } from "json2typescript/src/json2typescript/json-convert-enums"; +import { JsonConvert, JsonConverter, JsonCustomConvert, OperationMode, PropertyMatchingRule, ValueCheckingMode } from "json2typescript"; import { IId } from "../../../interfaces/models/v2/project-metadata-interfaces"; import { Constants } from "../Constants"; import { Attribution } from "../project-metadata/attribution"; @@ -20,7 +19,7 @@ export class UnionElementArrayOfElementsConverter implements JsonCustomConvert PropertyMatchingRule.CASE_STRICT ); - serialize(el: Attribution[] | Place[] | Grant[] | IId): any { + serialize(el: Attribution): any { if (Array.isArray(el)) { if (el[0].hasOwnProperty("type") && (el[0] as {type: string})["type"] === Constants.ProvAttribution) { return UnionElementArrayOfElementsConverter.jsonConvert.serializeArray(el, Attribution); diff --git a/src/models/v2/custom-converters/union-metadata-converter.ts b/src/models/v2/custom-converters/union-metadata-converter.ts index ba573d5b5..7f31723b7 100644 --- a/src/models/v2/custom-converters/union-metadata-converter.ts +++ b/src/models/v2/custom-converters/union-metadata-converter.ts @@ -1,5 +1,4 @@ -import { JsonConvert, JsonConverter, JsonCustomConvert, OperationMode, ValueCheckingMode } from "json2typescript"; -import { PropertyMatchingRule } from "json2typescript/src/json2typescript/json-convert-enums"; +import { JsonConvert, JsonConverter, JsonCustomConvert, OperationMode, PropertyMatchingRule, ValueCheckingMode } from "json2typescript"; import { Constants } from "../Constants"; import { DataManagementPlan } from "../project-metadata/data-management-plan"; import { Dataset } from "../project-metadata/dataset"; diff --git a/src/models/v2/custom-converters/union-orgnization-id-converter.ts b/src/models/v2/custom-converters/union-orgnization-id-converter.ts index d20303c8c..f2d3bc549 100644 --- a/src/models/v2/custom-converters/union-orgnization-id-converter.ts +++ b/src/models/v2/custom-converters/union-orgnization-id-converter.ts @@ -1,5 +1,4 @@ -import { JsonConvert, JsonConverter, JsonCustomConvert, OperationMode, ValueCheckingMode } from "json2typescript"; -import { PropertyMatchingRule } from "json2typescript/src/json2typescript/json-convert-enums"; +import { JsonConvert, JsonConverter, JsonCustomConvert, OperationMode, PropertyMatchingRule, ValueCheckingMode } from "json2typescript"; import { IId } from "../../../interfaces/models/v2/project-metadata-interfaces"; import { Constants } from "../Constants"; import { Organization } from "../project-metadata/organization"; diff --git a/src/models/v2/custom-converters/union-person-organization-id-converter.ts b/src/models/v2/custom-converters/union-person-organization-id-converter.ts index 3356b6153..9807e7247 100644 --- a/src/models/v2/custom-converters/union-person-organization-id-converter.ts +++ b/src/models/v2/custom-converters/union-person-organization-id-converter.ts @@ -1,5 +1,4 @@ -import { JsonConvert, JsonConverter, JsonCustomConvert, OperationMode, ValueCheckingMode } from "json2typescript"; -import { PropertyMatchingRule } from "json2typescript/src/json2typescript/json-convert-enums"; +import { JsonConvert, JsonConverter, JsonCustomConvert, OperationMode, PropertyMatchingRule, ValueCheckingMode } from "json2typescript"; import { IId } from "../../../interfaces/models/v2/project-metadata-interfaces"; import { Constants } from "../Constants"; import { Organization } from "../project-metadata/organization"; diff --git a/src/models/v2/custom-converters/union-single-project-id-converter.ts b/src/models/v2/custom-converters/union-single-project-id-converter.ts index 3ea878ec4..734c049db 100644 --- a/src/models/v2/custom-converters/union-single-project-id-converter.ts +++ b/src/models/v2/custom-converters/union-single-project-id-converter.ts @@ -1,5 +1,4 @@ -import { JsonConvert, JsonConverter, JsonCustomConvert, OperationMode, ValueCheckingMode } from "json2typescript"; -import { PropertyMatchingRule } from "json2typescript/src/json2typescript/json-convert-enums"; +import { JsonConvert, JsonConverter, JsonCustomConvert, OperationMode, PropertyMatchingRule, ValueCheckingMode } from "json2typescript"; import { IId } from "../../../interfaces/models/v2/project-metadata-interfaces"; import { Constants } from "../Constants"; import { SingleProject } from "../project-metadata/single-project"; diff --git a/src/models/v2/lists/list-node-v2.ts b/src/models/v2/lists/list-node-v2.ts index 77e573689..78a9941dd 100644 --- a/src/models/v2/lists/list-node-v2.ts +++ b/src/models/v2/lists/list-node-v2.ts @@ -5,9 +5,9 @@ import { JsonObject, JsonProperty, OperationMode, + PropertyMatchingRule, ValueCheckingMode } from "json2typescript"; -import { PropertyMatchingRule } from "json2typescript/src/json2typescript/json-convert-enums"; import { Constants } from "../Constants"; import { IdConverter } from "../custom-converters/id-converter"; diff --git a/src/models/v2/project-metadata/attribution.ts b/src/models/v2/project-metadata/attribution.ts index d27d67a8b..1a330b3b4 100644 --- a/src/models/v2/project-metadata/attribution.ts +++ b/src/models/v2/project-metadata/attribution.ts @@ -19,6 +19,9 @@ export class Attribution extends BaseProjectMetadata { @JsonProperty(Constants.ProvAgent, UnionPersonOrganizationIdConverter) agent: Array = []; + @JsonProperty("@id", String) + id: string = ""; + constructor() { super(Constants.ProvAttribution); } diff --git a/src/models/v2/resources/ResourcesConversionUtil.spec.ts b/src/models/v2/resources/ResourcesConversionUtil.spec.ts index 116a48561..a179045df 100644 --- a/src/models/v2/resources/ResourcesConversionUtil.spec.ts +++ b/src/models/v2/resources/ResourcesConversionUtil.spec.ts @@ -1,5 +1,4 @@ -import { JsonConvert, OperationMode, ValueCheckingMode } from "json2typescript"; -import { PropertyMatchingRule } from "json2typescript/src/json2typescript/json-convert-enums"; +import { JsonConvert, OperationMode, PropertyMatchingRule, ValueCheckingMode } from "json2typescript"; import { of } from "rxjs"; import { MockList } from "../../../../test/data/api/v2/mock-list"; import { MockOntology } from "../../../../test/data/api/v2/mock-ontology"; diff --git a/test/data/api/admin/mock-projects.ts b/test/data/api/admin/mock-projects.ts index b76e3e6ee..d78c35e6b 100644 --- a/test/data/api/admin/mock-projects.ts +++ b/test/data/api/admin/mock-projects.ts @@ -1,12 +1,10 @@ -import { JsonConvert, OperationMode, ValueCheckingMode } from "json2typescript"; -import { PropertyMatchingRule } from "json2typescript/src/json2typescript/json-convert-enums"; +import { JsonConvert, OperationMode, PropertyMatchingRule, ValueCheckingMode } from "json2typescript"; import { AjaxResponse } from "rxjs/ajax"; -import { ApiResponseData } from "../../../../src/models/api-response-data"; -import { ProjectsResponse } from "../../../../src/models/admin/projects-response"; import { ProjectResponse } from "../../../../src/models/admin/project-response"; - -import projects from "./projects/get-projects-response.json"; +import { ProjectsResponse } from "../../../../src/models/admin/projects-response"; +import { ApiResponseData } from "../../../../src/models/api-response-data"; import project from "./projects/get-project-response.json"; +import projects from "./projects/get-projects-response.json"; export namespace MockProjects { diff --git a/test/data/api/admin/mock-users.ts b/test/data/api/admin/mock-users.ts index 3873dff7e..ffb4cf59f 100644 --- a/test/data/api/admin/mock-users.ts +++ b/test/data/api/admin/mock-users.ts @@ -1,12 +1,10 @@ -import { JsonConvert, OperationMode, ValueCheckingMode } from "json2typescript"; -import { PropertyMatchingRule } from "json2typescript/src/json2typescript/json-convert-enums"; +import { JsonConvert, OperationMode, PropertyMatchingRule, ValueCheckingMode } from "json2typescript"; import { AjaxResponse } from "rxjs/ajax"; -import { ApiResponseData } from "../../../../src/models/api-response-data"; -import { UsersResponse } from "../../../../src/models/admin/users-response"; import { UserResponse } from "../../../../src/models/admin/user-response"; - -import users from "./users/get-users-response.json"; +import { UsersResponse } from "../../../../src/models/admin/users-response"; +import { ApiResponseData } from "../../../../src/models/api-response-data"; import user from "./users/get-user-response.json"; +import users from "./users/get-users-response.json"; export namespace MockUsers { diff --git a/test/data/api/v2/mock-list.ts b/test/data/api/v2/mock-list.ts index 168ccae5e..9f9e42ca3 100644 --- a/test/data/api/v2/mock-list.ts +++ b/test/data/api/v2/mock-list.ts @@ -1,9 +1,8 @@ -import { JsonConvert, OperationMode, ValueCheckingMode } from "json2typescript"; -import { PropertyMatchingRule } from "json2typescript/src/json2typescript/json-convert-enums"; +import { JsonConvert, OperationMode, PropertyMatchingRule, ValueCheckingMode } from "json2typescript"; import { ListConversionUtil } from "../../../../src/models/v2/lists/list-conversion-util"; import { ListNodeV2 } from "../../../../src/models/v2/lists/list-node-v2"; +import othertreeListExpanded from "../v2/lists/othertreelist-expanded.json"; import treeListExpanded from "../v2/lists/treelist-expanded.json"; -import othertreeListExpanded from "../v2/lists/othertreelist-expanded.json"; export namespace MockList { diff --git a/test/data/api/v2/mock-ontology.ts b/test/data/api/v2/mock-ontology.ts index 27d655c37..72532f400 100644 --- a/test/data/api/v2/mock-ontology.ts +++ b/test/data/api/v2/mock-ontology.ts @@ -1,10 +1,9 @@ -import { JsonConvert, OperationMode, ValueCheckingMode } from "json2typescript"; -import { PropertyMatchingRule } from "json2typescript/src/json2typescript/json-convert-enums"; -import { OntologiesMetadata } from "../../../../src/models/v2/ontologies/ontology-metadata"; +import { JsonConvert, OperationMode, PropertyMatchingRule, ValueCheckingMode } from "json2typescript"; import { ResourceClassAndPropertyDefinitions } from "../../../../src/cache/ontology-cache/resource-class-and-property-definitions"; import { ResourceClassDefinitionWithPropertyDefinition } from "../../../../src/cache/ontology-cache/resource-class-definition-with-property-definition"; import { Constants } from "../../../../src/models/v2/Constants"; import { IHasProperty } from "../../../../src/models/v2/ontologies/class-definition"; +import { OntologiesMetadata } from "../../../../src/models/v2/ontologies/ontology-metadata"; import { OntologyConversionUtil } from "../../../../src/models/v2/ontologies/OntologyConversionUtil"; import { PropertyDefinition } from "../../../../src/models/v2/ontologies/property-definition"; import { ReadOntology } from "../../../../src/models/v2/ontologies/read/read-ontology"; @@ -14,9 +13,9 @@ import { StandoffClassDefinition } from "../../../../src/models/v2/ontologies/st import { SystemPropertyDefinition } from "../../../../src/models/v2/ontologies/system-property-definition"; import ontologiesMetadata from "../v2/ontologies/all-ontology-metadata-response-expanded.json"; import anythingOntologyExpanded from "../v2/ontologies/anything-ontology-expanded.json"; -import minimalOntologyExpanded from "../v2/ontologies/minimal-ontology-expanded.json"; import incunabulaOntologyExpanded from "../v2/ontologies/incunabula-ontology-expanded.json"; import knoraApiOntologyExpanded from "../v2/ontologies/knora-api-ontology-expanded.json"; +import minimalOntologyExpanded from "../v2/ontologies/minimal-ontology-expanded.json"; export namespace MockOntology { diff --git a/test/data/api/v2/mock-resource.ts b/test/data/api/v2/mock-resource.ts index 395535c63..85f042499 100644 --- a/test/data/api/v2/mock-resource.ts +++ b/test/data/api/v2/mock-resource.ts @@ -1,5 +1,4 @@ -import { JsonConvert, OperationMode, ValueCheckingMode } from "json2typescript"; -import { PropertyMatchingRule } from "json2typescript/src/json2typescript/json-convert-enums"; +import { JsonConvert, OperationMode, PropertyMatchingRule, ValueCheckingMode } from "json2typescript"; import { forkJoin, Observable, of } from "rxjs"; import { map } from "rxjs/operators"; import { V2Endpoint } from "../../../../src/api/v2/v2-endpoint"; From 19d0acda831d1fbc9692a54b2ea6ca113d94219c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Kilchenmann?= Date: Thu, 9 Sep 2021 05:24:21 +0200 Subject: [PATCH 3/3] chore: revert previous changes --- .../union-element-array-of-elements-converter.ts | 2 +- src/models/v2/project-metadata/attribution.ts | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/models/v2/custom-converters/union-element-array-of-elements-converter.ts b/src/models/v2/custom-converters/union-element-array-of-elements-converter.ts index 2f6c48a94..e84918722 100644 --- a/src/models/v2/custom-converters/union-element-array-of-elements-converter.ts +++ b/src/models/v2/custom-converters/union-element-array-of-elements-converter.ts @@ -19,7 +19,7 @@ export class UnionElementArrayOfElementsConverter implements JsonCustomConvert PropertyMatchingRule.CASE_STRICT ); - serialize(el: Attribution): any { + serialize(el: Attribution[] | Place[] | Grant[] | IId): any { if (Array.isArray(el)) { if (el[0].hasOwnProperty("type") && (el[0] as {type: string})["type"] === Constants.ProvAttribution) { return UnionElementArrayOfElementsConverter.jsonConvert.serializeArray(el, Attribution); diff --git a/src/models/v2/project-metadata/attribution.ts b/src/models/v2/project-metadata/attribution.ts index 1a330b3b4..d27d67a8b 100644 --- a/src/models/v2/project-metadata/attribution.ts +++ b/src/models/v2/project-metadata/attribution.ts @@ -19,9 +19,6 @@ export class Attribution extends BaseProjectMetadata { @JsonProperty(Constants.ProvAgent, UnionPersonOrganizationIdConverter) agent: Array = []; - @JsonProperty("@id", String) - id: string = ""; - constructor() { super(Constants.ProvAttribution); }