Skip to content

Commit f766fc1

Browse files
alan-agius4filipesilva
authored andcommitted
refactor(@angular-devkit/core): deprecate flatten schema method.
The flatten schema method has been deprecated without replacement. Producing a flatten schema document does not in all cases produce a schema with identical behavior to the original. See: https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.appendix.B.2
1 parent 9af0942 commit f766fc1

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ export type PromptProvider = (definitions: Array<PromptDefinition>)
113113

114114
export interface SchemaRegistry {
115115
compile(schema: Object): Observable<SchemaValidator>;
116+
/**
117+
* @deprecated since 11.2 without replacement.
118+
* Producing a flatten schema document does not in all cases produce a schema with identical behavior to the original.
119+
* See: https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.appendix.B.2
120+
*/
116121
flatten(schema: JsonObject | string): Observable<JsonObject>;
117122
addFormat(format: SchemaFormat): void;
118123
addSmartDefaultProvider<T>(source: string, provider: SmartDefaultProvider<T>): void;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,9 @@ export class CoreSchemaRegistry implements SchemaRegistry {
239239
*
240240
* @param schema The schema or URI to flatten.
241241
* @returns An Observable of the flattened schema object.
242+
* @deprecated since 11.2 without replacement.
243+
* Producing a flatten schema document does not in all cases produce a schema with identical behavior to the original.
244+
* See: https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.appendix.B.2
242245
*/
243246
flatten(schema: JsonObject): Observable<JsonObject> {
244247
this._ajv.removeSchema(schema);

0 commit comments

Comments
 (0)