json_schema icon indicating copy to clipboard operation
json_schema copied to clipboard

ValidationResults not exported

Open hamishnorton opened this issue 2 years ago • 0 comments

Type

Improvement

Details

Currently to return the results to a high level, such as when you have wrapped it in a method, have to add the specific import for ValidationResultss, like the following.

import 'package:json_schema/json_schema.dart';
// ignore: implementation_imports
import 'package:json_schema/src/json_schema/models/validation_results.dart';

class JsonSchemaService {
  late final JsonSchema _schema;

  JsonSchemaService(Map<String, dynamic> schema) {
    _schema = JsonSchema.create(schema);
  }

  ValidationResults isValid(dynamic data) {
    final results = _schema.validate(data);
    return results;
  }
}

Possible Solution

export ValidationResults

Your Environment

  • Version: json_schema: ^5.1.3

FYI: @michaelcarter-wf

hamishnorton avatar Oct 18 '23 22:10 hamishnorton