From 9480d4cd08af6b37749d97eb0eb59b8acc76c591 Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Tue, 16 Jul 2024 16:38:07 -0400 Subject: [PATCH] add `Cancel` schema to `Validator` --- lib/src/protocol/validator.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/src/protocol/validator.dart b/lib/src/protocol/validator.dart index be51392..ff39393 100644 --- a/lib/src/protocol/validator.dart +++ b/lib/src/protocol/validator.dart @@ -3,6 +3,7 @@ import 'dart:convert'; import 'package:json_schema/json_schema.dart'; import 'package:path/path.dart' as p; import 'package:tbdex/src/protocol/exceptions.dart'; +import 'package:tbdex/src/protocol/json_schemas/cancel_schema.dart'; import 'package:tbdex/src/protocol/json_schemas/close_schema.dart'; import 'package:tbdex/src/protocol/json_schemas/definitions_schema.dart'; import 'package:tbdex/src/protocol/json_schemas/message_schema.dart'; @@ -139,6 +140,8 @@ class Validator { final schemasPath = p.join('lib', 'src', 'protocol', 'json_schemas'); final refProvider = _createRefProvider(schemasPath); + _schemaMap['cancel'] = + JsonSchema.create(CancelSchema.json, refProvider: refProvider); _schemaMap['close'] = JsonSchema.create(CloseSchema.json, refProvider: refProvider); _schemaMap['definitions'] =