reproto parser


Keywords
csharp, dsl, idl, java, javascript, json, protocol-specification, python, rust, swift
Licenses
MIT/Apache-2.0

Documentation

reproto

Build Status Build status Chat on Gitter

A better way to define schemas for your JSON.

Introduction

If you want to take the system for a spin, please go to https://reproto.github.io.

Reproto is:

  • A compiler capable of generating code for various languages.
    try it outdocumentation
  • A language server providing first-class integration with a large number of editors.
    documentation
  • A custom interface description language that permits describing the schema of JSON and services in a concise, easy to understand way.
    documentation
  • Early and extensive soundness checking, with excellent error handling. We catch schema issues before you know that you have them.
    ui tests
  • A derive command, capable of deriving schemas directly from JSON.
    try it outdocumentation.
  • A semantic version checker which verifies that modifications to schemas do not violate semantic versioning.
    documentation
  • A build system with a package manager using build manifests, giving you all the control you need to integrate reproto into your project.
    documentation
  • A rich, markdown-based documentation generator.
    documentation

These things combined support an ecosystem where schemas can be maintained and shared across many teams.

You can install a binary version of reproto by running:

curl https://raw.githubusercontent.com/reproto/reproto/master/install.sh -sSf | bash

Note: This project is in an early stage. Things will change a lot. Please take it for a spin, but avoid building large repositories of schemas for now.

Getting Started

  • See the documentation for an overview of how the reproto language and its build manifest works.
  • See examples for some example specifications and projects.
  • See the integration tests for even more examples on how protocol specifications can be used.
  • See CHANGELOG.md for past and coming changes.

Helping Out

You want to help out? Great!

You might want to start on issues marked with good first issue. If you have a support for a programming language that you feel is lacking, please help out with language support.

For any of these, just poke the issue with a quick I want to do this!. If mentoring instructions are lacking, they will be made available as soon as possible. Also make sure to join our Gitter channel.

Language Support

Language JSON gRPC HTTP/1.1*
Java ✔️ ✔️ ✔️ test
Python ✔️ ✖️ ✔️ test
C# ✔️ ✖️ ✖️
Rust ✔️ ✖️ ✔️ test
JavaScript ✔️ ✖️ ✖️
Swift ✔️ ✖️ ✖️
Go ✔️ ✖️ ✖️

*: HTTP/1.1 support is actively being outlined in #2

Generating Documentation

reproto can generate rich markdown-based documentation from your specifications.

Go to https://reproto.github.io/reproto/doc-examples/ to see what this documentation looks like.

These have been generated from the examples project using tools/update-doc-examples.

Installing from Source

Make sure you have gotten started with Rust.

Initialize submodules:

git submodule update --init

Pack syntax highlighting and themes:

make dumps

Build and install the CLI. This will install reproto into ~/.cargo/bin, make sure it is in your PATH:

cargo install --path $PWD/cli reproto

Tools

  • reproto-vim, a VIM plugin that provides syntax highlighting.
  • reproto-maven, Maven plugin that integrates reproto into the build lifecycle of a maven project.
  • reproto-vscode, a visual studio code extension providing syntax highlighting and in-editor error diagnostics.

Testing

This project includes an extensive set of integration tests.

See make help for documentation on what can be done.

Suites are fast tests which compiles a given set of rules, and compares with expected output stored in this repository.

make suites

Projects are complete project tests. These are projects written for various programming languages, and are generally harder to build.

make projects

To run all tests, do:

make all

For more information, run make help.