ToolHints.fromJson constructor

ToolHints.fromJson(
  1. Map<String, Object?> json
)

Reads the protocol's annotations object; absent hints are false.

Implementation

factory ToolHints.fromJson(Map<String, Object?> json) => ToolHints(
  readOnly: json['readOnlyHint'] == true,
  destructive:
      json['destructiveHint'] == true && json['readOnlyHint'] != true,
  idempotent: json['idempotentHint'] == true,
  openWorld: json['openWorldHint'] == true,
  title: json['title'] as String?,
);