Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/src/json_schema/formats/idn_email_validator.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import 'package:json_schema/src/json_schema/models/validation_context.dart';
import 'package:rfc_6531/rfc_6531.dart' as rfc_6531;

ValidationContext defaultIdnEmailValidator(ValidationContext context, String instanceData) {
// No maintained dart packages exist to validate RFC6531,
// and it's too complex for a regex, so best effort is to pass for now.
if (rfc_6531.regExp.firstMatch(instanceData) == null) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we validate this format by default on the default schema version draft7, this is a breaking behavioral change. No need to handle this in your PR, but FYI we'll cut this as 6.0.0

context.addError('"idn-email" format not accepted $instanceData');
}
return context;
}
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dependencies:
collection: ^1.15.0
http: ">=0.13.4 <2.0.0"
logging: ^1.0.0
rfc_6531: ^1.0.0
rfc_6901: '>=0.1.0 <0.3.0'
uri: '>=0.11.1 <2.0.0'

Expand Down