DataSchema class

Metadata that describes the data format used. It can be used for validation.

See W3C WoT Thing Description specification, section 5.3.2.1.

Implementers
Annotations
  • @immutable

Constructors

DataSchema({List<String>? atType, String? title, Map<String, String>? titles, String? description, Map<String, String>? descriptions, Object? constant, Object? defaultValue, String? unit, List<DataSchema>? oneOf, List<Object>? enumeration, bool? readOnly = false, bool? writeOnly = false, String? format, String? type, num? minimum, num? exclusiveMinimum, num? maximum, num? exclusiveMaximum, num? multipleOf, List<DataSchema>? items, int? minItems, int? maxItems, Map<String, DataSchema>? properties, List<String>? required, int? minLength, int? maxLength, String? pattern, String? contentEncoding, String? contentMediaType, Map<String, dynamic>? rawJson, Map<String, dynamic>? additionalFields})
Constructor
const
DataSchema.fromJson(Map<String, dynamic> json, PrefixMapping prefixMapping, [Set<String>? parsedFields])
Creates a new DataSchema from a json object.
factory

Properties

additionalFields Map<String, dynamic>?
Additional fields that could not be deserialized as class members.
final
atType List<String>?
JSON-LD keyword (@type) to label the object with semantic tags (or types).
final
constant Object?
A constant value.
final
contentEncoding String?
Specifies the encoding used to store the contents, as specified in RFC 2045 (Section 6.1) and RFC 4648.
final
contentMediaType String?
Specifies the MIME type of the contents of a string value, as described in RFC 2046.
final
defaultValue Object?
A default value if no actual value is set.
final
description String?
The default description of this DataSchema.
final
descriptions Map<String, String>?
A multi-language map of descriptions.
final
enumeration List<Object>?
Restricted set of values provided as a List.
final
exclusiveMaximum num?
Specifies a maximum numeric value, representing an exclusive upper limit.
final
exclusiveMinimum num?
Specifies a minimum numeric value, representing an exclusive lower limit.
final
format String?
Allows validation based on a format pattern.
final
hashCode int
The hash code for this object.
no setterinherited
items List<DataSchema>?
Used to define the characteristics of an array.
final
maximum num?
Specifies a maximum numeric value, representing an inclusive upper limit.
final
maxItems int?
Defines the maximum number of items that have to be in an array.
final
maxLength int?
Specifies the maximum length of a string.
final
minimum num?
Specifies a minimum numeric value, representing an inclusive lower limit.
final
minItems int?
Defines the minimum number of items that have to be in an array.
final
minLength int?
Specifies the minimum length of a string.
final
multipleOf num?
Specifies the multipleOf value number. The value must strictly greater than 0.
final
oneOf List<DataSchema>?
Allows the specification of multiple DataSchemas for validation.
final
pattern String?
Provides a regular expression to express constraints of the string value.
final
properties Map<String, DataSchema>?
Data schema nested definitions in an object.
final
rawJson Map<String, dynamic>?
The original JSON object that was parsed when creating this DataSchema.
final
readOnly bool?
Indicates if a value is read only.
final
required List<String>?
Defines which members of the object type are mandatory, i.e. which members are mandatory in the payload that is to be sent (e.g. input of invokeaction, writeproperty) and what members will be definitely delivered in the payload that is being received (e.g. output of invokeaction, readproperty).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
title String?
The (default) title of this DataSchema.
final
titles Map<String, String>?
A multi-language map of titles.
final
type String?
JSON-based data type compatible with JSON Schema.
final
unit String?
The unit of the value.
final
writeOnly bool?
Indicates if a value is write only.
final

Methods

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