openrpc_dart 0.1.3 copy "openrpc_dart: ^0.1.3" to clipboard
openrpc_dart: ^0.1.3 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 = [
    "api-with-examples-openrpc.json",
    "empty-openrpc.json",
    "link-example-openrpc.json",
    "metrics-openrpc.json",
    "params-by-name-petstore-openrpc.json",
    // "petstore-expanded-openrpc.json",    //allOf, oneOf, anyOf UNSUPPORTED
    "petstore-openrpc.json",
    "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
130
points
171
downloads

Publisher

verified publisherdjbird.top

Weekly Downloads

An OpenRPC JSON Spec Parser, fromJson and toJson

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

json_annotation

More

Packages that depend on openrpc_dart