A crate to parse (maybe later also serialize) OpenRPC documents. OpenRPC is a specification for describing JsonRPC apis.
We made this to use as a base for a code generator that generates wrapper code in multiple languages. [not realized yet, this crate is the first step]
See https://github.com/open-rpc/typings if you need a code generator for types right now.
-
ServerObject.name
attribute is currently optional, where in the spec it is required, because the official examples don't follow the spec here, see: open-rpc/examples#647 -
LinkObject.name
attribute is currently optional, same reason as above, see open-rpc/examples#648
- Make references work (
OrRef
type, currently it does not parse correctly) - Implement automated testing (smoke tests are sufficient for now)
- add more examples (from openrpc)
- Maybe add some convenience function for resolving references? (only local ones remote ones will error for now I'd say)
-
ErrorObject.data
(maybe serde_json::Value?) -
LinkObject
-
ExampleObject
MIT or Apache, whatever suits you best. Most Documentation comments are under Apache License 2.0, because they were taken from https://spec.open-rpc.org/.
run all tests, even if some fail:
cargo test --no-fail-fast
To test the parsing of a file you can run it through the "cli":
cargo run -- example_files/openrpc-examples/simple-math-openrpc.json > result
(pipe output to a file or to |less
, because the file can be very long)