We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f52f043 commit 2c6c398Copy full SHA for 2c6c398
1 file changed
packages/angular_devkit/core/src/json/schema/registry.ts
@@ -43,7 +43,8 @@ interface AjvRefMap {
43
schema: JsonObject;
44
}
45
46
-export type UriHandler = (uri: string) => Observable<JsonObject> | null | undefined;
+export type UriHandler = (uri: string) =>
47
+ Observable<JsonObject> | Promise<JsonObject> | null | undefined;
48
49
export class SchemaValidationException extends BaseException {
50
public readonly errors: SchemaValidatorError[];
@@ -133,7 +134,7 @@ export class CoreSchemaRegistry implements SchemaRegistry {
133
134
const handler = maybeHandler(uri);
135
if (handler) {
136
// The AJV API only understands Promises.
- return handler.pipe(
137
+ return from(handler).pipe(
138
tap(json => this._uriCache.set(uri, json)),
139
).toPromise();
140
0 commit comments