Skip to content

Commit

Permalink
feat: parse uriVariables at the affordance level
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Mar 11, 2022
1 parent 22ee3f1 commit d5dd268
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ abstract class InteractionAffordance {
/// The basic [forms] which can be used for interacting with this resource.
List<Form> forms;

/// URI template variables as defined in [RFC 6570].
///
/// [RFC 6570]: http://tools.ietf.org/html/rfc6570
Map<String, Object?>? uriVariables;

/// A list of [forms] augmented with additional information.
///
/// This information includes base addresses and security definitions.
Expand Down Expand Up @@ -70,6 +75,13 @@ abstract class InteractionAffordance {
}

descriptions = _parseMultilangString(json, "descriptions");

if (json["uriVariables"] != null) {
final dynamic jsonUriVariables = json["uriVariables"];
if (jsonUriVariables is Map<String, dynamic>) {
uriVariables = jsonUriVariables;
}
}
}

/// Creates a new [InteractionAffordance]. Accepts a [List] of [forms].
Expand Down

0 comments on commit d5dd268

Please sign in to comment.