Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
ReProto Compiler
The ReProto project is a language-neutral protocol specification, aimed towards describing and generating code for handling messages exchanged through JSON-based APIs.
ReProto specifies a DSL that described JSON types and services. Using this, models can be generated using multiple different target languages.
- See Specification for details on what the syntax of
.reprotofiles is. - See TODO for details on things that still needs to be done.
- See Examples for some example protocol specifications.
- See Config for how to configure ReProto.
- See Integration Tests for some examples of how protocol specifications can be used.
Note: This project is in an Alpha-stage. Things will change a lot.
Supported Backends
- Java (
java)- Data models using fasterxml jackson (
-m fasterxml), and/or lombok (-m lombok).
- Data models using fasterxml jackson (
- JavaScript (
js)- ES2015 classes, that can be transpiled using babel (see Integration Test).
- Python (
python)- Plain-python classes, compatible with 2 and 3 for databinding.
- Rust (
rust)- Serde-based serialization.
- Doc (
doc)- HTML-based documentation, based from contextual markdown comments.
Examples
Make you have gotten started with Rust.
Build ReProto using cargo:
This will install the command into ~/.cargo/bin, make sure it is in your $PATH.
Build documentation:
For more example, please have a look at our integration tests.
Maven Plugin
A Maven plugin that integrates reproto into the build lifecycle of a maven project.
VIM Plugin
A VIM plugin that provides syntax highlighting.
Testing
This project includes an extensive set of integration tests.
See make help for documentation on what can be done.
Suites are tests which compiled a given set of rules, and compares with expected output.
Projects are complete project tests. These are projects written for various programming languages, and are generally harder to build.
The tool check-project-deps is used to determine
which projects your local system can build.
To run all tests, do:
The ReProto DSL
The goal is to provide an intuitive and productive specification language. For this reason, ReProto uses a DSL that is not based on existing markup (JSON, YAML, ...). This is also reduces the signal to noise ratio.
As a comparison, the following is a specification using OpenAPI 2.0, compared with ReProto.
/// # ReProto Petstore
///
/// A sample API that uses a petstore as an example to demonstrate features in the ReProto
/// specification
service Petstore {
"api" {
/// Returns all pets from the system that the user has access to.
GET "pets" {
/// A list of pets.
returns [Pet] {
status 200;
produces "application/json";
}
}
}
}
type Pet {
id: unsigned/64;
name: string;
tag?: string;
}
You can compile the above into documentation using the following command:
If you miss JSON, you can compile the specification to JSON as well.