From 0c92ea5ca34d82849862d55c4210cf62c819d514 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Tue, 10 Aug 2021 14:32:06 +0200 Subject: [PATCH] feat(@angular-devkit/core): remove deprecated schema id handling BREAKING CHANGE: With this change we drop support for the deprecated behaviour to transform `id` in schemas. Use `$id` instead. Note: this only effects schematics and builders authors. --- .../core/src/json/schema/registry.ts | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/packages/angular_devkit/core/src/json/schema/registry.ts b/packages/angular_devkit/core/src/json/schema/registry.ts index 652b2327eef2..bc8262ba8540 100644 --- a/packages/angular_devkit/core/src/json/schema/registry.ts +++ b/packages/angular_devkit/core/src/json/schema/registry.ts @@ -235,7 +235,6 @@ export class CoreSchemaRegistry implements SchemaRegistry { } private async _flatten(schema: JsonObject): Promise { - this._replaceDeprecatedSchemaIdKeyword(schema); this._ajv.removeSchema(schema); this._currentCompilationSchemaInfo = undefined; @@ -294,8 +293,6 @@ export class CoreSchemaRegistry implements SchemaRegistry { return async (data) => ({ success: schema, data }); } - this._replaceDeprecatedSchemaIdKeyword(schema); - const schemaInfo: SchemaInfo = { smartDefaultRecord: new Map(), promptDefinitions: [], @@ -680,22 +677,6 @@ export class CoreSchemaRegistry implements SchemaRegistry { }); } - /** - * Workaround to avoid a breaking change in downstream schematics. - * @deprecated will be removed in version 13. - */ - private _replaceDeprecatedSchemaIdKeyword(schema: JsonObject): void { - if (typeof schema.id === 'string') { - schema.$id = schema.id; - delete schema.id; - - // eslint-disable-next-line no-console - console.warn( - `"${schema.$id}" schema is using the keyword "id" which its support is deprecated. Use "$id" for schema ID.`, - ); - } - } - private normalizeDataPathArr(it: SchemaObjCxt): (number | string)[] { return it.dataPathArr .slice(1, it.dataLevel + 1)