Skip to content

Commit 0c92ea5

Browse files
committed
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.
1 parent e95ecb8 commit 0c92ea5

File tree

1 file changed

+0
-19
lines changed
  • packages/angular_devkit/core/src/json/schema

1 file changed

+0
-19
lines changed

packages/angular_devkit/core/src/json/schema/registry.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ export class CoreSchemaRegistry implements SchemaRegistry {
235235
}
236236

237237
private async _flatten(schema: JsonObject): Promise<JsonObject> {
238-
this._replaceDeprecatedSchemaIdKeyword(schema);
239238
this._ajv.removeSchema(schema);
240239

241240
this._currentCompilationSchemaInfo = undefined;
@@ -294,8 +293,6 @@ export class CoreSchemaRegistry implements SchemaRegistry {
294293
return async (data) => ({ success: schema, data });
295294
}
296295

297-
this._replaceDeprecatedSchemaIdKeyword(schema);
298-
299296
const schemaInfo: SchemaInfo = {
300297
smartDefaultRecord: new Map<string, JsonObject>(),
301298
promptDefinitions: [],
@@ -680,22 +677,6 @@ export class CoreSchemaRegistry implements SchemaRegistry {
680677
});
681678
}
682679

683-
/**
684-
* Workaround to avoid a breaking change in downstream schematics.
685-
* @deprecated will be removed in version 13.
686-
*/
687-
private _replaceDeprecatedSchemaIdKeyword(schema: JsonObject): void {
688-
if (typeof schema.id === 'string') {
689-
schema.$id = schema.id;
690-
delete schema.id;
691-
692-
// eslint-disable-next-line no-console
693-
console.warn(
694-
`"${schema.$id}" schema is using the keyword "id" which its support is deprecated. Use "$id" for schema ID.`,
695-
);
696-
}
697-
}
698-
699680
private normalizeDataPathArr(it: SchemaObjCxt): (number | string)[] {
700681
return it.dataPathArr
701682
.slice(1, it.dataLevel + 1)

0 commit comments

Comments
 (0)