Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
fix: refactor to json_schemas (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanwlee authored May 6, 2024
1 parent ec6f9af commit 16c13c9
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion generate_schemas.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:path/path.dart' as p;

void main() {
final schemasPath = p.join('tbdex', 'hosted', 'json-schemas');
final outputDir = Directory('lib/src/protocol/json-schemas')
final outputDir = Directory('lib/src/protocol/json_schemas')
..createSync(recursive: true);

Directory(schemasPath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class BalanceSchema {
"additionalProperties": false,
"currencyCode": {
"type": "string",
"description": "ISO 3166 currency code string"
"description": "ISO 4217 currency code string"
},
"available": {
"$ref": "definitions.json#/definitions/decimalString",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class OfferingSchema {
"properties": {
"currencyCode": {
"type": "string",
"description": "ISO 3166 currency code string"
"description": "ISO 4217 currency code string"
},
"min": {
"$ref": "definitions.json#/definitions/decimalString",
Expand Down Expand Up @@ -49,7 +49,7 @@ class OfferingSchema {
"description": "Value that can be used to group specific payment methods together (e.g. Mobile Money vs. Direct Bank Deposit)."
},
"requiredPaymentDetails": {
"$ref": "http://json-schema.org/draft-07/schema",
"$ref": "http://json-schema.org/draft-07/schema#",
"description": "A JSON Schema containing the fields that need to be collected in order to use this payment method"
},
"min": {
Expand Down Expand Up @@ -77,7 +77,7 @@ class OfferingSchema {
"properties": {
"currencyCode": {
"type": "string",
"description": "ISO 3166 currency code string"
"description": "ISO 4217 currency code string"
},
"min": {
"$ref": "definitions.json#/definitions/decimalString",
Expand Down Expand Up @@ -110,7 +110,7 @@ class OfferingSchema {
"description": "Value that can be used to group specific payment methods together (e.g. Mobile Money vs. Direct Bank Deposit)."
},
"requiredPaymentDetails": {
"$ref": "http://json-schema.org/draft-07/schema",
"$ref": "http://json-schema.org/draft-07/schema#",
"description": "A JSON Schema containing the fields that need to be collected in order to use this payment method"
},
"min": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class QuoteSchema {
"properties": {
"currencyCode": {
"type": "string",
"description": "ISO 3166 currency code string"
"description": "ISO 4217 currency code string"
},
"amount": {
"$ref": "definitions.json#/definitions/decimalString",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ class RfqPrivateSchema {
"required": ["salt"]
}
''';
}
}
22 changes: 11 additions & 11 deletions lib/src/protocol/validator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ 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/close_schema.dart';
import 'package:tbdex/src/protocol/json-schemas/definitions_schema.dart';
import 'package:tbdex/src/protocol/json-schemas/message_schema.dart';
import 'package:tbdex/src/protocol/json-schemas/offering_schema.dart';
import 'package:tbdex/src/protocol/json-schemas/order_schema.dart';
import 'package:tbdex/src/protocol/json-schemas/orderstatus_schema.dart';
import 'package:tbdex/src/protocol/json-schemas/quote_schema.dart';
import 'package:tbdex/src/protocol/json-schemas/resource_schema.dart';
import 'package:tbdex/src/protocol/json-schemas/rfq_private_schema.dart';
import 'package:tbdex/src/protocol/json-schemas/rfq_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';
import 'package:tbdex/src/protocol/json_schemas/offering_schema.dart';
import 'package:tbdex/src/protocol/json_schemas/order_schema.dart';
import 'package:tbdex/src/protocol/json_schemas/orderstatus_schema.dart';
import 'package:tbdex/src/protocol/json_schemas/quote_schema.dart';
import 'package:tbdex/src/protocol/json_schemas/resource_schema.dart';
import 'package:tbdex/src/protocol/json_schemas/rfq_private_schema.dart';
import 'package:tbdex/src/protocol/json_schemas/rfq_schema.dart';
import 'package:tbdex/src/protocol/models/close.dart';
import 'package:tbdex/src/protocol/models/message.dart';
import 'package:tbdex/src/protocol/models/offering.dart';
Expand Down Expand Up @@ -130,7 +130,7 @@ class Validator {
}

static void _initialize() {
final schemasPath = p.join('lib', 'src', 'protocol', 'json-schemas');
final schemasPath = p.join('lib', 'src', 'protocol', 'json_schemas');
final refProvider = _createRefProvider(schemasPath);

_schemaMap['close'] =
Expand Down

0 comments on commit 16c13c9

Please sign in to comment.