JsonValidatorByScheme class

class is instantiated via calling constructor passing in scheme of json record and json record scheme is expected as a Map of key string with value of List: such list would be in the following structure of elements: first element: datatype of item second element: a bool representing whether item is required in record or not third element: a list representing the possible values in record for the item. (if no validation on value needed, do not pass this third list element) example: scheme {"my salute item": ["String", true, "Hi", "Hello"]} means that the valid record would be {"my salute item": "Hi"} or {"my salute item": "Hello"}

Constructors

JsonValidatorByScheme(Map<String, List> pscheme, Map<String, dynamic> ptarget)
constructor to pass the json record as ptarget and the validation scheme as pscheme

Properties

errorFlags List<String>
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scheme Map<String, List>
getter/setter pair
targetJSON Map<String, dynamic>
getter/setter pair

Methods

isValid() bool
isvalid method returns a bool of whether json record is valid to scheme or not and appends any deviations from scheme to ErrorFlags List
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited