Skip to content

Commit

Permalink
fix: make List and Map fields final in TD and Form
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Jan 22, 2022
1 parent 8a648bc commit a612506
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/src/definitions/form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Form {
/// The [href] pointing to the resource.
///
/// Can be a relative or absolute URI.
late String href;
late final String href;

/// The subprotocol that is used with this [Form].
String? subprotocol;
Expand Down
12 changes: 6 additions & 6 deletions lib/src/definitions/thing_description.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ class ThingDescription {
final Map<String, String> descriptions = {};

/// The JSON-LD `@context`, represented by a [List] of [ContextEntry]s.
List<ContextEntry> context = [];
final List<ContextEntry> context = [];

/// A [Map] of [Property] Affordances.
Map<String, Property> properties = {};
final Map<String, Property> properties = {};

/// A [Map] of [Action] Affordances.
Map<String, Action> actions = {};
final Map<String, Action> actions = {};

/// A [Map] of [Event] Affordances.
Map<String, Event> events = {};
final Map<String, Event> events = {};

/// A [List] of [Link]s.
final List<Link> links = [];
Expand All @@ -60,7 +60,7 @@ class ThingDescription {
/// A [List] of the [securityDefinitions] that are used as the default.
///
/// Each entry has to be a key of the [securityDefinitions] Map.
List<String> security = [];
final List<String> security = [];

/// A map of [SecurityScheme]s that can be used for secure communication.
final Map<String, SecurityScheme> securityDefinitions = {};
Expand Down Expand Up @@ -114,7 +114,7 @@ class ThingDescription {
}
final dynamic security = json["security"];
if (security is List<String>) {
this.security = security;
this.security.addAll(security);
}
final dynamic securityDefinitions = json["securityDefinitions"];
if (securityDefinitions is Map<String, dynamic>) {
Expand Down

0 comments on commit a612506

Please sign in to comment.