openrpc_dart 0.1.1 copy "openrpc_dart: ^0.1.1" to clipboard
openrpc_dart: ^0.1.1 copied to clipboard

An OpenRPC JSON Spec Parser, fromJson and toJson

example/openrpc_dart_example.dart

import 'package:openrpc_dart/openrpc_dart.dart';
import 'dart:io';

void main() async {
  List<String> jsonFileNameList = [];
  jsonFileNameList.add("api-with-examples-openrpc.json");
  jsonFileNameList.add("empty-openrpc.json");
  jsonFileNameList.add("link-example-openrpc.json");
  jsonFileNameList.add("metrics-openrpc.json");
  jsonFileNameList.add("params-by-name-petstore-openrpc.json");
  jsonFileNameList.add("petstore-expanded-openrpc.json");
  jsonFileNameList.add("petstore-openrpc.json");
  jsonFileNameList.add("simple-math-openrpc.json");

  String currentWorkingDirectory = Directory.current.path;
  jsonFileNameList.forEach((jsonFileName) async {
    print("FILE_NAME: $jsonFileName");
    String jsonPath = "$currentWorkingDirectory/example/json/$jsonFileName";
    OpenRPCLoader openRPCLoader = OpenRPCLoader();
    OpenRPC openRPC = await openRPCLoader.loadFromFile(jsonPath);
    print("title: ${openRPC.info.title}");
  });
}
0
likes
0
points
171
downloads

Publisher

verified publisherdjbird.top

Weekly Downloads

An OpenRPC JSON Spec Parser, fromJson and toJson

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

json_annotation

More

Packages that depend on openrpc_dart